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:
Martin Hořeňovský
2025-07-29 23:51:13 +02:00
parent a1c7ee115f
commit ccabd4de89
20 changed files with 164 additions and 29 deletions

View File

@@ -166,6 +166,10 @@ ok {test-number} - smallest_non_zero, WithinULP( -smallest_non_zero, 2 ) for: 0.
ok {test-number} - smallest_non_zero, !WithinULP( -smallest_non_zero, 1 ) for: 0.0f not is within 1 ULPs of -1.40129846e-45f ([-2.80259693e-45, -0.00000000e+00])
# #2615 - Throwing in constructor generator fails test case but does not abort
not ok {test-number} - unexpected exception with message: 'failure to init'; expression was: {Unknown expression after the reported line}
# #3001: Enum-based bitfields can be captured
ok {test-number} - bf.e == 1 for: 1 == 1
# #3001: Enum-based bitfields can be captured
ok {test-number} - 1 == bf.e for: 1 == 1
# #748 - captures with unexpected exceptions
not ok {test-number} - unexpected exception with message: 'expected exception'; expression was: {Unknown expression after the reported line}
# #748 - captures with unexpected exceptions
@@ -4597,5 +4601,5 @@ ok {test-number} - q3 == 23. for: 23.0 == 23.0
ok {test-number} -
# xmlentitycheck
ok {test-number} -
1..2300
1..2302