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

@@ -655,6 +655,7 @@ at Class.tests.cpp:<line number>
<testCase name="#1319: Sections can have description (even if it is not saved/SectionName" duration="{duration}"/>
<testCase name="#1403" duration="{duration}"/>
<testCase name="#1548" duration="{duration}"/>
<testCase name="#3001: Enum-based bitfields can be captured" duration="{duration}"/>
<testCase name="#809" duration="{duration}"/>
<testCase name="#833" duration="{duration}"/>
<testCase name="#872" duration="{duration}"/>