diff options
author | Abseil Team <absl-team@google.com> | 2020-04-22T17·52-0700 |
---|---|---|
committer | Derek Mauro <dmauro@google.com> | 2020-04-22T18·03+0000 |
commit | 902909a430e2558ad446294159af39bf019a1ef6 (patch) | |
tree | 1efe99ef701d2afad97677797e977cdac40cce50 /absl/flags/internal | |
parent | cb52b05ea20e8d196f17b45a420c2d323e401324 (diff) |
Export of internal Abseil changes
-- 692d3df279e7592d01c1008cb85f2a010c3d17da by Abseil Team <absl-team@google.com>: Use EXPECT_DEATH_IF_SUPPORTED instead of raw EXPECT_DEATH. PiperOrigin-RevId: 307802196 -- ebc40936b677b79cad9f87f944794c35946f9dbd by Gennadiy Rozental <rogeeff@google.com>: Eliminate SetCallback from absl::Flag<T> public interface. We also make SetCallback on FlagRegistrar to return rvalue, so that we can add more tail calls after it. PiperOrigin-RevId: 307745935 GitOrigin-RevId: 15f69a9dae9c70c884ce85ca1a4bf359a2609db0 Change-Id: Ibec13463e44e4071c48fb12389f47e716cee7a9d
Diffstat (limited to 'absl/flags/internal')
-rw-r--r-- | absl/flags/internal/flag.h | 7 | ||||
-rw-r--r-- | absl/flags/internal/usage_test.cc | 5 |
2 files changed, 5 insertions, 7 deletions
diff --git a/absl/flags/internal/flag.h b/absl/flags/internal/flag.h index 2ae3dce3d13d..6da25aa9454a 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 e1e57e557091..8dd3532e6d40 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 } |