mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-03 22:05:39 +02:00
Add enum types to what is captured by value by default
As it turns out, enums can be used to declare bitfields, and we cannot form a reference to a bitfield in the cpature. Thus, we add `std::is_enum` as a criteria to the default for `capture_by_value`, so that enum-based bitfields are also captured by value and thus decomposable. Closes #3001
This commit is contained in:
@@ -770,6 +770,22 @@ Generators.tests.cpp:<line number>: FAILED:
|
||||
due to unexpected exception with message:
|
||||
failure to init
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
#3001: Enum-based bitfields can be captured
|
||||
-------------------------------------------------------------------------------
|
||||
Compilation.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Compilation.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE( bf.e == 1 )
|
||||
with expansion:
|
||||
1 == 1
|
||||
|
||||
Compilation.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE( 1 == bf.e )
|
||||
with expansion:
|
||||
1 == 1
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
#748 - captures with unexpected exceptions
|
||||
outside assertions
|
||||
@@ -19173,6 +19189,6 @@ Misc.tests.cpp:<line number>
|
||||
Misc.tests.cpp:<line number>: PASSED:
|
||||
|
||||
===============================================================================
|
||||
test cases: 431 | 313 passed | 95 failed | 6 skipped | 17 failed as expected
|
||||
assertions: 2288 | 2090 passed | 157 failed | 41 failed as expected
|
||||
test cases: 432 | 314 passed | 95 failed | 6 skipped | 17 failed as expected
|
||||
assertions: 2290 | 2092 passed | 157 failed | 41 failed as expected
|
||||
|
||||
|
Reference in New Issue
Block a user