public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/115806] New: No error for enum redefinition in template
@ 2024-07-06 14:10 nshead at gcc dot gnu.org
  2024-07-06 15:08 ` [Bug c++/115806] [11/12/13/14/15 Regression] No error for member enum redefinition in class template (even after instantiation) pinskia at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: nshead at gcc dot gnu.org @ 2024-07-06 14:10 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 115806
           Summary: No error for enum redefinition in template
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nshead at gcc dot gnu.org
  Target Milestone: ---

The following code currently compiles with no error:

  template <typename T>
  struct S {
    enum E { a };
    enum E { b };
  };
  S<int> s;

The same code without S being a template correctly errors with:

<source>:3:10: error: multiple definition of 'enum S::E'
    3 |     enum E {b};
      |          ^
<source>:2:10: note: previous definition here
    2 |     enum E {a};
      |          ^

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

end of thread, other threads:[~2024-08-09 15:18 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-06 14:10 [Bug c++/115806] New: No error for enum redefinition in template nshead at gcc dot gnu.org
2024-07-06 15:08 ` [Bug c++/115806] [11/12/13/14/15 Regression] No error for member enum redefinition in class template (even after instantiation) pinskia at gcc dot gnu.org
2024-07-07 18:48 ` pinskia at gcc dot gnu.org
2024-07-19 13:26 ` [Bug c++/115806] [12/13/14/15 " rguenth at gcc dot gnu.org
2024-08-08 14:03 ` simartin at gcc dot gnu.org
2024-08-08 14:48 ` simartin at gcc dot gnu.org
2024-08-09 15:16 ` cvs-commit at gcc dot gnu.org
2024-08-09 15:18 ` simartin 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).