mirror of
https://github.com/catchorg/Catch2.git
synced 2025-11-07 07:19:33 +01:00
Fixed -Wunused-value warnings from Clang 3.4 in THROWS/NOTHROW use.
These warnings were emitted by test suites that included any test
cases for std::bad_cast exceptions being thrown or not thrown, as
per the following example:
REQUIRE_THROWS_AS((bool)my_object, std::bad_cast);
This commit is contained in:
@@ -106,7 +106,7 @@ struct TestFailureException{};
|
||||
do { \
|
||||
INTERNAL_CATCH_ACCEPT_INFO( #expr, macroName, resultDisposition ); \
|
||||
try { \
|
||||
expr; \
|
||||
static_cast<void>(expr); \
|
||||
INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( Catch::ResultWas::Ok ), resultDisposition, false ); \
|
||||
} \
|
||||
catch( ... ) { \
|
||||
@@ -118,7 +118,7 @@ struct TestFailureException{};
|
||||
#define INTERNAL_CATCH_THROWS_IMPL( expr, exceptionType, resultDisposition ) \
|
||||
try { \
|
||||
if( Catch::getCurrentContext().getConfig()->allowThrows() ) { \
|
||||
expr; \
|
||||
static_cast<void>(expr); \
|
||||
INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( Catch::ResultWas::DidntThrowException ), resultDisposition, false ); \
|
||||
} \
|
||||
} \
|
||||
|
||||
Reference in New Issue
Block a user