Suppress unused variable warning for template test cases
The variable initialization has test registration as a side-effect, but as far as GCC is concerned, the variable itself is unused. Because the macro substitution always happens at global scope, we cannot use cast to `void` as is usually done.
This commit is contained in:
2 files changed
+19
-1
No files matched your search
@@ -53,6 +53,9 @@
|
||||
// for older versions of GCC.
|
||||
# define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS \
|
||||
_Pragma( "GCC diagnostic ignored \"-Wparentheses\"" )
|
||||
|
||||
# define CATCH_INTERNAL_SUPPRESS_UNUSED_WARNINGS \
|
||||
_Pragma( "GCC diagnostic ignored \"-Wunused-variable\"" )
|
||||
#endif
|
||||
|
||||
#if defined(__clang__)
|
||||
|
||||
Reference in new issue
Block a user