public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/67678] New: Nested class can be re-declared after definition
@ 2015-09-22 10:04 redi at gcc dot gnu.org
  2015-09-26 16:56 ` [Bug c++/67678] " daniel.kruegler at googlemail dot com
  2015-09-26 19:24 ` redi at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: redi at gcc dot gnu.org @ 2015-09-22 10:04 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 67678
           Summary: Nested class can be re-declared after definition
           Product: gcc
           Version: 5.2.1
            Status: UNCONFIRMED
          Keywords: accepts-invalid
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org
  Target Milestone: ---

This should give a diagnostic:

struct A { struct B{}; struct B; };

9.2 [class.mem] p1:

   A member shall not be declared twice in the member-specification,
   except that a nested class or member class template can be declared
   and then later defined, [...]


Clang warns:

x.cc:1:31: warning: class member cannot be redeclared
[-Wredeclared-class-member]
struct A { struct B{}; struct B; };
                              ^
x.cc:1:19: note: previous declaration is here
struct A { struct B{}; struct B; };
                  ^
1 warning generated.

EDG warns:

"x.cc", line 1: warning: invalid redeclaration of nested class
  struct A { struct B{}; struct B; };
                                ^


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

end of thread, other threads:[~2015-09-26 19:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-22 10:04 [Bug c++/67678] New: Nested class can be re-declared after definition redi at gcc dot gnu.org
2015-09-26 16:56 ` [Bug c++/67678] " daniel.kruegler at googlemail dot com
2015-09-26 19:24 ` redi 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).