mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-17 03:02:24 +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:
parent
472dc2a61f
commit
fa2366ba12
@ -106,7 +106,7 @@ struct TestFailureException{};
|
|||||||
do { \
|
do { \
|
||||||
INTERNAL_CATCH_ACCEPT_INFO( #expr, macroName, resultDisposition ); \
|
INTERNAL_CATCH_ACCEPT_INFO( #expr, macroName, resultDisposition ); \
|
||||||
try { \
|
try { \
|
||||||
expr; \
|
static_cast<void>(expr); \
|
||||||
INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( Catch::ResultWas::Ok ), resultDisposition, false ); \
|
INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( Catch::ResultWas::Ok ), resultDisposition, false ); \
|
||||||
} \
|
} \
|
||||||
catch( ... ) { \
|
catch( ... ) { \
|
||||||
@ -118,7 +118,7 @@ struct TestFailureException{};
|
|||||||
#define INTERNAL_CATCH_THROWS_IMPL( expr, exceptionType, resultDisposition ) \
|
#define INTERNAL_CATCH_THROWS_IMPL( expr, exceptionType, resultDisposition ) \
|
||||||
try { \
|
try { \
|
||||||
if( Catch::getCurrentContext().getConfig()->allowThrows() ) { \
|
if( Catch::getCurrentContext().getConfig()->allowThrows() ) { \
|
||||||
expr; \
|
static_cast<void>(expr); \
|
||||||
INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( Catch::ResultWas::DidntThrowException ), resultDisposition, false ); \
|
INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( Catch::ResultWas::DidntThrowException ), resultDisposition, false ); \
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
|
Loading…
Reference in New Issue
Block a user