diff options
Diffstat (limited to 'absl/types/variant_exception_safety_test.cc')
-rw-r--r-- | absl/types/variant_exception_safety_test.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/absl/types/variant_exception_safety_test.cc b/absl/types/variant_exception_safety_test.cc index 76beb595925d..fd7e6c7fe802 100644 --- a/absl/types/variant_exception_safety_test.cc +++ b/absl/types/variant_exception_safety_test.cc @@ -14,6 +14,12 @@ #include "absl/types/variant.h" +#include "absl/base/config.h" + +// This test is a no-op when absl::variant is an alias for std::variant and when +// exceptions are not enabled. +#if !defined(ABSL_HAVE_STD_VARIANT) && defined(ABSL_HAVE_EXCEPTIONS) + #include <iostream> #include <memory> #include <utility> @@ -21,7 +27,6 @@ #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "absl/base/config.h" #include "absl/base/internal/exception_safety_testing.h" #include "absl/memory/memory.h" @@ -521,3 +526,5 @@ TEST(VariantExceptionSafetyTest, Swap) { } // namespace absl #endif // !defined(ABSL_INTERNAL_MSVC_2017_DBG_MODE) + +#endif // #if !defined(ABSL_HAVE_STD_VARIANT) && defined(ABSL_HAVE_EXCEPTIONS) |