https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127802
Bug ID: 127802
Summary: [reflection] missing "expected 'template' keyword" for
dependent splices
Product: gcc
Version: 17.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: ---
We accept function templates in splice-exprs even without the template
keyword, and emit a warning about the missing keyword. But we only call
missing_template_diag while parsing, so if the splice is dependent, there is no
warning.
```
template<typename T> int fn (T) { return 0; }
int i = [:^^fn:](0); // OK, we get diag
template<auto R>
int
f ()
{
return [:R:](0); // missing "expected 'template' keyword before dependent
template name"
}
void
g ()
{
f<^^fn> ();
}
```