public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/115338] New: Missing -Wpedantic warning for class-specifier for nested type in class scope.
@ 2024-06-04  7:20 email at miropalmu dot cc
  2024-06-05  0:39 ` [Bug c++/115338] " pinskia at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: email at miropalmu dot cc @ 2024-06-04  7:20 UTC (permalink / raw)
  To: gcc-bugs

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug c++/115338] Missing -Wpedantic warning for class-specifier for nested type in class scope.
  2024-06-04  7:20 [Bug c++/115338] New: Missing -Wpedantic warning for class-specifier for nested type in class scope email at miropalmu dot cc
@ 2024-06-05  0:39 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-06-05  0:39 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115338

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
MSVC and GCC accepts it.
EDG and clang rejects it.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-06-05  0:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-04  7:20 [Bug c++/115338] New: Missing -Wpedantic warning for class-specifier for nested type in class scope email at miropalmu dot cc
2024-06-05  0:39 ` [Bug c++/115338] " pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).