mirror of
https://github.com/catchorg/Catch2.git
synced 2025-06-03 18:37:56 +00:00
REQUIRE_THROWS_AS now catches exception by const&
Prevents some warnings caused by catching complex types by value. Closes #542
This commit is contained in:
parent
9952dda524
commit
73159ace3d
4 changed files with 68 additions and 1 deletions
|
@ -16,6 +16,7 @@
|
|||
#include "catch_tostring.h"
|
||||
#include "catch_interfaces_runner.h"
|
||||
#include "catch_compiler_capabilities.h"
|
||||
#include "catch_type_traits.hpp"
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -93,7 +94,7 @@
|
|||
static_cast<void>(expr); \
|
||||
__catchResult.captureResult( Catch::ResultWas::DidntThrowException ); \
|
||||
} \
|
||||
catch( exceptionType ) { \
|
||||
catch( Catch::add_const<Catch::add_lvalue_reference<exceptionType>::type>::type ) { \
|
||||
__catchResult.captureResult( Catch::ResultWas::Ok ); \
|
||||
} \
|
||||
catch( ... ) { \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue