Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMartin Hořeňovský2022-07-12 00:05:56 +0200
committerMartin Hořeňovský2022-07-15 19:34:35 +0200
commitcc0e91472aa7f5dc28388be57c2ee8d3340c365f (patch)
treed3a65eecb7b81025c0eaba23c8dee71fd443e044
parent3bd0c58878bb4d413a4ef9ed701ec08e407420ab (diff)
downloadcatch3-cc0e91472aa7f5dc28388be57c2ee8d3340c365f.tar.gz
Different way of checking for support of local warning suppression
Closes #2474
-rw-r--r--src/catch2/internal/catch_compiler_capabilities.hpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/catch2/internal/catch_compiler_capabilities.hpp b/src/catch2/internal/catch_compiler_capabilities.hpp
index 00280277..fffe59e7 100644
--- a/src/catch2/internal/catch_compiler_capabilities.hpp
+++ b/src/catch2/internal/catch_compiler_capabilities.hpp
@@ -63,11 +63,17 @@
# define CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS _Pragma( "nv_diag_suppress 177" )
#endif
+// clang-cl defines _MSC_VER as well as __clang__, which could cause the
+// start/stop internal suppression macros to be double defined.
#if defined(__clang__) && !defined(_MSC_VER)
# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION _Pragma( "clang diagnostic push" )
# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION _Pragma( "clang diagnostic pop" )
+#endif // __clang__ && !_MSC_VER
+
+#if defined(__clang__)
+
// As of this writing, IBM XL's implementation of __builtin_constant_p has a bug
// which results in calls to destructors being emitted for each temporary,
// without a matching initialization. In practice, this can result in something