[Bug c++/123608] New: [reflection] reflection in default arg rejected
mpolacek at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Jan 15 16:59:48 GMT 2026
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123608
Bug ID: 123608
Summary: [reflection] reflection in default arg rejected
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: mpolacek at gcc dot gnu.org
Target Milestone: ---
```
#include <meta>
consteval bool f(int a, std::meta::info b = ^^a) { return is_variable(b); }
static_assert(f(42));
```
is rejected with:
error: default argument '^^a' uses local variable 'a'
More information about the Gcc-bugs
mailing list