Changed rhs expression capture from universal ref to const ref.

- addresses #1027
This commit is contained in:
Phil Nash
2017-10-13 14:16:14 +01:00
parent ba6845a865
commit c2b7bd15c0
6 changed files with 68 additions and 21 deletions

View File

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