mirror of
https://github.com/catchorg/Catch2.git
synced 2025-09-24 13:35:40 +02:00
Changed rhs expression capture from universal ref to const ref.
- addresses #1027
This commit is contained in:
@@ -168,7 +168,7 @@ namespace ObjectWithConversions
|
||||
{
|
||||
struct Object
|
||||
{
|
||||
operator unsigned int() {return 0xc0000000;}
|
||||
operator unsigned int() const {return 0xc0000000;}
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
@@ -436,3 +436,12 @@ TEST_CASE("#925: comparing function pointer to function address failed to compil
|
||||
TestClass test;
|
||||
REQUIRE(utility::synchronizing_callback != test.testMethod_uponComplete_arg);
|
||||
}
|
||||
|
||||
TEST_CASE( "Bitfields can be captured (#1027)" ) {
|
||||
struct Y {
|
||||
uint32_t v : 1;
|
||||
};
|
||||
Y y{ 0 };
|
||||
REQUIRE( y.v == 0 );
|
||||
REQUIRE( 0 == y.v );
|
||||
}
|
||||
|
Reference in New Issue
Block a user