https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120340
Bug ID: 120340
Summary: Can define a struct type with a trailing return type
on a function type as decl inside a function
Product: gcc
Version: 14.0
Status: UNCONFIRMED
Keywords: accepts-invalid
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: pinskia at gcc dot gnu.org
Target Milestone: ---
```
void f() {
auto(*x)()->struct{};
}
```
Should be rejected as the trailing return type is a new type def.
Outside of a function we have a parse error for the new type for the trailing
return type.
Note if we try to use x, x says it is not declared in the scope.
So this might be just an invalid code which will never really show up unless
you are looking for it.