summaryrefslogtreecommitdiff
path: root/absl/flags/internal
diff options
context:
space:
mode:
Diffstat (limited to 'absl/flags/internal')
-rw-r--r--absl/flags/internal/flag.h7
-rw-r--r--absl/flags/internal/usage_test.cc5
2 files changed, 5 insertions, 7 deletions
diff --git a/absl/flags/internal/flag.h b/absl/flags/internal/flag.h
index 2ae3dce3..6da25aa9 100644
--- a/absl/flags/internal/flag.h
+++ b/absl/flags/internal/flag.h
@@ -556,9 +556,6 @@ class Flag {
impl_.AssertValidType(base_internal::FastTypeId<T>(), &GenRuntimeTypeId<T>);
impl_.Write(&v);
}
- void SetCallback(const FlagCallbackFunc mutation_callback) {
- impl_.SetCallback(mutation_callback);
- }
// CommandLineFlag interface
absl::string_view Name() const { return impl_.Name(); }
@@ -651,8 +648,8 @@ class FlagRegistrar {
if (do_register) flags_internal::RegisterCommandLineFlag(&flag_->impl_);
}
- FlagRegistrar& OnUpdate(FlagCallbackFunc cb) && {
- flag_->SetCallback(cb);
+ FlagRegistrar OnUpdate(FlagCallbackFunc cb) && {
+ flag_->impl_.SetCallback(cb);
return *this;
}
diff --git a/absl/flags/internal/usage_test.cc b/absl/flags/internal/usage_test.cc
index e1e57e55..8dd3532e 100644
--- a/absl/flags/internal/usage_test.cc
+++ b/absl/flags/internal/usage_test.cc
@@ -103,8 +103,9 @@ TEST_F(UsageReportingDeathTest, TestSetProgramUsageMessage) {
#ifndef _WIN32
// TODO(rogeeff): figure out why this does not work on Windows.
- EXPECT_DEATH(absl::SetProgramUsageMessage("custom usage message"),
- ".*SetProgramUsageMessage\\(\\) called twice.*");
+ EXPECT_DEATH_IF_SUPPORTED(
+ absl::SetProgramUsageMessage("custom usage message"),
+ ".*SetProgramUsageMessage\\(\\) called twice.*");
#endif
}