https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115338
Bug ID: 115338
Summary: Missing -Wpedantic warning for class-specifier for
nested type in class scope.
Product: gcc
Version: 15.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: email at miropalmu dot cc
Target Milestone: ---
Following compiles on a GCC 15.0.0 20240604 without warnings with flags
-std=c++26 -Wall -Wextra -Wpedantic (https://godbolt.org/z/zeYdKMj9a):
```
struct Foo {
struct Bar {
struct Mar;
};
struct Bar::Mar {};
};
```
However it should be ill-formed or at least give warning with -Wpedantic,
as [class.pre] states (https://eel.is/c++draft/class.pre#3):
> If a class-head-name contains a nested-name-specifier,
> the class-specifier shall not inhabit a class scope.
`Bar::Mar` is a class-head-name and `bar::` is a nested-name-specifier.