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

summaryrefslogtreecommitdiffhomepage
path: root/src/catch2/internal
diff options
context:
space:
mode:
authorMartin Hořeňovský2023-05-17 11:10:57 +0200
committerMartin Hořeňovský2023-05-28 21:07:31 +0200
commitf60c15364bb4be1c9a34f19eac06f085828a2c5e (patch)
tree2f5c5e8e74f861aac5a9c9de3cb2e7b3caabe63f /src/catch2/internal
parentb3cf1bfb5d2476b1793c9ebc845803d60ce34171 (diff)
downloadcatch3-f60c15364bb4be1c9a34f19eac06f085828a2c5e.tar.gz
Add macro for suppressing Wshadow
Diffstat (limited to 'src/catch2/internal')
-rw-r--r--src/catch2/internal/catch_compiler_capabilities.hpp23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/catch2/internal/catch_compiler_capabilities.hpp b/src/catch2/internal/catch_compiler_capabilities.hpp
index 76afb45f..fc5d4f31 100644
--- a/src/catch2/internal/catch_compiler_capabilities.hpp
+++ b/src/catch2/internal/catch_compiler_capabilities.hpp
@@ -59,6 +59,9 @@
# define CATCH_INTERNAL_SUPPRESS_USELESS_CAST_WARNINGS \
_Pragma( "GCC diagnostic ignored \"-Wuseless-cast\"" )
+# define CATCH_INTERNAL_SUPPRESS_SHADOW_WARNINGS \
+ _Pragma( "GCC diagnostic ignored \"-Wshadow\"" )
+
# define CATCH_INTERNAL_IGNORE_BUT_WARN(...) (void)__builtin_constant_p(__VA_ARGS__)
#endif
@@ -131,6 +134,9 @@
# define CATCH_INTERNAL_SUPPRESS_COMMA_WARNINGS \
_Pragma( "clang diagnostic ignored \"-Wcomma\"" )
+# define CATCH_INTERNAL_SUPPRESS_SHADOW_WARNINGS \
+ _Pragma( "clang diagnostic ignored \"-Wshadow\"" )
+
#endif // __clang__
@@ -380,6 +386,16 @@
#if !defined(CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS)
# define CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS
#endif
+#if !defined( CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS )
+# define CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS
+#endif
+#if !defined( CATCH_INTERNAL_SUPPRESS_COMMA_WARNINGS )
+# define CATCH_INTERNAL_SUPPRESS_COMMA_WARNINGS
+#endif
+#if !defined( CATCH_INTERNAL_SUPPRESS_SHADOW_WARNINGS )
+# define CATCH_INTERNAL_SUPPRESS_SHADOW_WARNINGS
+#endif
+
// The goal of this macro is to avoid evaluation of the arguments, but
// still have the compiler warn on problems inside...
@@ -393,13 +409,6 @@
# undef CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS
#endif
-#if !defined(CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS)
-# define CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS
-#endif
-
-#if !defined(CATCH_INTERNAL_SUPPRESS_COMMA_WARNINGS)
-# define CATCH_INTERNAL_SUPPRESS_COMMA_WARNINGS
-#endif
#if defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
#define CATCH_TRY if ((true))