https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124070
Bug ID: 124070
Summary: [reflection] injected decl not detected in default
argument
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: ---
Dan K. points out that we emit no diagnostic for:
```
#include <meta>
struct S;
template <std::meta::info I = define_aggregate(^^S, {})>
constexpr void f() {}
consteval {
f<>();
}
```
but since the template argument is a separate definition from the consteval
block, [expr.const]/9.30 says it shouldn't be core constant:
-- an expression that would produce an injected declaration (see below), unless
E is the corresponding expression of a consteval-block-declaration