diff options
| author | Martin Hořeňovský | 2019-10-27 21:07:21 +0100 |
|---|---|---|
| committer | Martin Hořeňovský | 2019-10-27 21:07:21 +0100 |
| commit | 849f2848bdf625a7b6248e4e62ba0e39ee609634 (patch) | |
| tree | a2d90be167769ef9bb7b0cd32d431eeb94eebc05 /projects | |
| parent | 2fbd66c51cbf3a406dc6bb8ddc6b9a0b96077a72 (diff) | |
| download | catch3-849f2848bdf625a7b6248e4e62ba0e39ee609634.tar.gz | |
Rework how warning suppression in macros is done
Previously, each warning suppression was self-contained, with its
own pair of `SUPPRESS_X_WARNING` and `UNSUPPRESS_X_WARNING` macros.
This had the obvious advantage of being self-containing, but it
also meant that if we needed to suppress more than one warning
in a single place, then we would manipulate the compiler's warning
state multiple times, even though logically we would only need one
layer.
The new way of suppressing warnings in macros is to push compiler's
warning state with `CATCH_INTERNAL_START_WARNINGS_SUPPRESSION` macro,
then disable whatever macros we need with the
`CATCH_INTERNAL_SUPPRESS_X_WARNINGS` macro, and then return to the
previous state using `CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION`.
Diffstat (limited to 'projects')
| -rw-r--r-- | projects/SelfTest/UsageTests/Misc.tests.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/projects/SelfTest/UsageTests/Misc.tests.cpp b/projects/SelfTest/UsageTests/Misc.tests.cpp index 188bc2d7..808d1d0a 100644 --- a/projects/SelfTest/UsageTests/Misc.tests.cpp +++ b/projects/SelfTest/UsageTests/Misc.tests.cpp @@ -58,9 +58,11 @@ struct AutoTestReg { REGISTER_TEST_CASE( manuallyRegisteredTestFunction, "ManuallyRegistered" ); } }; + +CATCH_INTERNAL_START_WARNINGS_SUPPRESSION CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS static AutoTestReg autoTestReg; -CATCH_INTERNAL_UNSUPPRESS_GLOBALS_WARNINGS +CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION template<typename T> struct Foo { |