diff options
Diffstat (limited to 'absl/types/optional_exception_safety_test.cc')
-rw-r--r-- | absl/types/optional_exception_safety_test.cc | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/absl/types/optional_exception_safety_test.cc b/absl/types/optional_exception_safety_test.cc index 056ced42..8e5fe851 100644 --- a/absl/types/optional_exception_safety_test.cc +++ b/absl/types/optional_exception_safety_test.cc @@ -14,11 +14,17 @@ #include "absl/types/optional.h" +#include "absl/base/config.h" + +// This test is a no-op when absl::optional is an alias for std::optional and +// when exceptions are not enabled. +#if !defined(ABSL_USES_STD_OPTIONAL) && defined(ABSL_HAVE_EXCEPTIONS) + #include "gtest/gtest.h" #include "absl/base/internal/exception_safety_testing.h" namespace absl { -inline namespace lts_2019_08_08 { +ABSL_NAMESPACE_BEGIN namespace { @@ -280,5 +286,7 @@ TEST(OptionalExceptionSafety, NothrowMoveAssign) { } // namespace -} // inline namespace lts_2019_08_08 +ABSL_NAMESPACE_END } // namespace absl + +#endif // #if !defined(ABSL_USES_STD_OPTIONAL) && defined(ABSL_HAVE_EXCEPTIONS) |