This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/33287] namespace hides class definition
- From: "reichelt at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 Dec 2007 19:40:15 -0000
- Subject: [Bug c++/33287] namespace hides class definition
- References: <bug-33287-15054@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from reichelt at gcc dot gnu dot org 2007-12-26 19:40 -------
To sum things up:
* The code is invalid, i.e. it shouldn't compile.
* GCC up to 4.2.x rejected the code for the wrong reason:
bug.cc:24: error: 'C1' does not name a type
This message is way too late.
GCC should have rejected the declaration of the namespace C1.
* Mainline GCC produces a correct diagnostic:
bug.cc:12: error: 'namespace C1 { }' redeclared as different kind of symbol
bug.cc:2: error: previous declaration of 'class C1'
This is due to the fix mentioned in comment #2, namely for PR 30734,
aka PR 2708. Since this bug wasn't a regression, the fix won't be
backported to current branches.
Although the submitter probably thought of the problem as an rejects-valid
bug, this is really an accepts-invalid bug in the first place.
*** This bug has been marked as a duplicate of 30734 ***
--
reichelt at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |reichelt at gcc dot gnu dot
| |org
Status|UNCONFIRMED |RESOLVED
Resolution| |DUPLICATE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33287