summaryrefslogtreecommitdiff
path: root/absl/flags
diff options
context:
space:
mode:
Diffstat (limited to 'absl/flags')
-rw-r--r--absl/flags/reflection.cc2
-rw-r--r--absl/flags/reflection_test.cc2
2 files changed, 2 insertions, 2 deletions
diff --git a/absl/flags/reflection.cc b/absl/flags/reflection.cc
index c6bf8aab..c976d467 100644
--- a/absl/flags/reflection.cc
+++ b/absl/flags/reflection.cc
@@ -328,7 +328,7 @@ CommandLineFlag* FindCommandLineFlag(absl::string_view name) {
absl::flat_hash_map<absl::string_view, absl::CommandLineFlag*> GetAllFlags() {
absl::flat_hash_map<absl::string_view, absl::CommandLineFlag*> res;
flags_internal::ForEachFlag([&](CommandLineFlag& flag) {
- res.insert({flag.Name(), &flag});
+ if (!flag.IsRetired()) res.insert({flag.Name(), &flag});
});
return res;
}
diff --git a/absl/flags/reflection_test.cc b/absl/flags/reflection_test.cc
index 1a1dcb4a..8620d140 100644
--- a/absl/flags/reflection_test.cc
+++ b/absl/flags/reflection_test.cc
@@ -70,7 +70,7 @@ TEST_F(ReflectionTest, TestGetAllFlags) {
auto all_flags = absl::GetAllFlags();
EXPECT_NE(all_flags.find("int_flag"), all_flags.end());
- EXPECT_NE(all_flags.find("bool_retired_flag"), all_flags.end());
+ EXPECT_EQ(all_flags.find("bool_retired_flag"), all_flags.end());
EXPECT_NE(all_flags.find("help"), all_flags.end());
EXPECT_EQ(all_flags.find("some_undefined_flag"), all_flags.end());