diff options
Diffstat (limited to 'absl/types/optional_exception_safety_test.cc')
-rw-r--r-- | absl/types/optional_exception_safety_test.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/absl/types/optional_exception_safety_test.cc b/absl/types/optional_exception_safety_test.cc index aaf8ebcd9886..f99e35c05447 100644 --- a/absl/types/optional_exception_safety_test.cc +++ b/absl/types/optional_exception_safety_test.cc @@ -14,6 +14,12 @@ #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_HAVE_STD_OPTIONAL) && defined(ABSL_HAVE_EXCEPTIONS) + #include "gtest/gtest.h" #include "absl/base/internal/exception_safety_testing.h" @@ -280,3 +286,5 @@ TEST(OptionalExceptionSafety, NothrowMoveAssign) { } // namespace } // namespace absl + +#endif // #if !defined(ABSL_HAVE_STD_OPTIONAL) && defined(ABSL_HAVE_EXCEPTIONS) |