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:
Arto Bendiken 2014-03-20 04:09:36 +01:00
parent 472dc2a61f
commit fa2366ba12

View File

@ -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 ); \
} \ } \
} \ } \