Skip to content

Commit 6cd6d31

Browse files
committed
Unit test framwork: use references when catching exceptions
GCC 8 warns about catching by value; this was not caught in the earlier cleanup as it did not include unit tests.
1 parent 6882da6 commit 6cd6d31

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

jbmc/unit/java_bytecode/java_types/erase_type_arguments.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,6 @@ SCENARIO("erase_type_arguments", "[core][java_types]")
6363
REQUIRE_THROWS_AS(
6464
erase_type_arguments(
6565
"testClassName<testTypeArgument1<testTypeArgument2>"),
66-
unsupported_java_class_signature_exceptiont &);
66+
unsupported_java_class_signature_exceptiont);
6767
}
6868
}

unit/testing-utils/catch.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -2245,7 +2245,7 @@ namespace Catch {
22452245
static_cast<void>(expr); \
22462246
__catchResult.captureResult( Catch::ResultWas::DidntThrowException ); \
22472247
} \
2248-
catch( exceptionType ) { \
2248+
catch( const exceptionType & ) { \
22492249
__catchResult.captureResult( Catch::ResultWas::Ok ); \
22502250
} \
22512251
catch( ... ) { \

0 commit comments

Comments
 (0)