Using single_include/catch.hpp revision 85d33e2cbd5354c36000424f823fc87707a24c3c, compiling with clang++ -O0 -g -fmessage-length=0 -pedantic -std=c++11 -Wall -Wextra -Wno-c++98-compat -Weverything -c -o test2.o test2.cpp shows the warnings:
./catch.hpp:6041:32: warning: declaration requires an exit-time destructor [-Wexit-time-destructors]
static PosixColourImpl s_instance;
^
./catch.hpp:6057:37: warning: declaration requires an exit-time destructor [-Wexit-time-destructors]
static NoColourImpl s_instance;
^
./catch.hpp:7184:33: warning: declaration requires an exit-time destructor [-Wexit-time-destructors]
static TagAliasRegistry instance;
^
test2.cpp:5:1: warning: declaration requires an exit-time destructor [-Wexit-time-destructors]
TEST_CASE("foo", "bar") {
^
This ticket is very old (sorry I didn't respond originally). Catch has changed substantially since then - especially wrt warnings.
I suspect these issues no longer exist, so I'm marking this for closure soon, unless anyone objects?
OBJECTION
The issue still exists.
Warning levels:
-Weverything
-pedantic
-pedantic-errors
-Wextra-tokens
-Wambiguous-member-template
-Wbind-to-temporary-copy
-Wno-c++98-compat
We use a workaround for clang:
#define SUPPRESS_WARNINGS_CATCH_BEGIN \
_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Wexit-time-destructors\"")
#define SUPPRESS_WARNINGS_CATCH_END _Pragma("clang diagnostic pop")
and then we enclose all the tests into a pair of SUPPRESS_WARNINGS_CATCH_BEGIN and SUPPRESS_WARNINGS_CATCH_END.
Most helpful comment
OBJECTION
The issue still exists.
Warning levels:
We use a workaround for clang:
and then we enclose all the tests into a pair of
SUPPRESS_WARNINGS_CATCH_BEGINandSUPPRESS_WARNINGS_CATCH_END.