Skip to content

Commit

Permalink
Suppress GCC useless-cast warning from CHECK_THROWS_MATCHES
Browse files Browse the repository at this point in the history
Suppress warning from GCC about useless cast in the
CHECK_THROWS_MATCHES macro the same way it is already being done for
the similar CHECK macros.
  • Loading branch information
laudrup committed Sep 5, 2024
1 parent fa306fc commit 1397c7b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/catch2/matchers/internal/catch_matchers_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ namespace Catch {
Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(__VA_ARGS__) ", " CATCH_INTERNAL_STRINGIFY(exceptionType) ", " CATCH_INTERNAL_STRINGIFY(matcher), resultDisposition ); \
if( catchAssertionHandler.allowThrows() ) \
try { \
CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
CATCH_INTERNAL_SUPPRESS_USELESS_CAST_WARNINGS \
static_cast<void>(__VA_ARGS__ ); \
CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
catchAssertionHandler.handleUnexpectedExceptionNotThrown(); \
} \
catch( exceptionType const& ex ) { \
Expand Down

0 comments on commit 1397c7b

Please sign in to comment.