about summary refs log tree commit diff
path: root/third_party/abseil_cpp/absl/flags/commandlineflag.h
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/abseil_cpp/absl/flags/commandlineflag.h')
-rw-r--r--third_party/abseil_cpp/absl/flags/commandlineflag.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/third_party/abseil_cpp/absl/flags/commandlineflag.h b/third_party/abseil_cpp/absl/flags/commandlineflag.h
index 7e21d05d8a53..f2fa08977fd4 100644
--- a/third_party/abseil_cpp/absl/flags/commandlineflag.h
+++ b/third_party/abseil_cpp/absl/flags/commandlineflag.h
@@ -108,6 +108,10 @@ class CommandLineFlag {
     U u;
 
     Read(&u.value);
+    // allow retired flags to be "read", so we can report invalid access.
+    if (IsRetired()) {
+      return absl::nullopt;
+    }
     return std::move(u.value);
   }