public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/115339] New: Missing -Wpedantic warning for a declarative nested-name-specifier with a decltype-specifier.
@ 2024-06-04  7:31 email at miropalmu dot cc
  2024-06-04 15:57 ` [Bug c++/115339] " mpolacek at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: email at miropalmu dot cc @ 2024-06-04  7:31 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 115339
           Summary: Missing -Wpedantic warning for a declarative
                    nested-name-specifier with a decltype-specifier.
           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/6fdbo9YcW):

```
struct X {
    struct a;
};
auto x = X{};
struct decltype(x)::a{};
```

However it should be ill-formed or at least give warning with -Wpedantic,
as [expr.prim.id.general] states (https://eel.is/c++draft/expr.prim.id#qual-2):

> A declarative nested-name-specifier shall not have a decltype-specifier.

`decltype(x)` is declarative nested-name-specifier as it is part of
class-head-name.

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

* [Bug c++/115339] Missing -Wpedantic warning for a declarative nested-name-specifier with a decltype-specifier.
  2024-06-04  7:31 [Bug c++/115339] New: Missing -Wpedantic warning for a declarative nested-name-specifier with a decltype-specifier email at miropalmu dot cc
@ 2024-06-04 15:57 ` mpolacek at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2024-06-04 15:57 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mpolacek at gcc dot gnu.org
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=68996

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
I think it's basically a dup of bug 68996.

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

end of thread, other threads:[~2024-06-04 15:57 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:31 [Bug c++/115339] New: Missing -Wpedantic warning for a declarative nested-name-specifier with a decltype-specifier email at miropalmu dot cc
2024-06-04 15:57 ` [Bug c++/115339] " mpolacek 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).