[Bug c++/33287] namespace hides class definition

2007-12-26 Thread reichelt 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



[Bug c++/33287] namespace hides class definition

2007-09-03 Thread pinskia at gcc dot gnu dot org


--- Comment #1 from pinskia at gcc dot gnu dot org  2007-09-03 18:05 ---
Yes and this correct.
Though the error was wrong.
On the trunk we get:
t.cc:12: error: 'namespace C1 { }' redeclared as different kind of symbol
t.cc:2: error: previous declaration of 'class C1'


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33287



[Bug c++/33287] namespace hides class definition

2007-09-03 Thread fang at csl dot cornell dot edu


--- Comment #2 from fang at csl dot cornell dot edu  2007-09-03 18:11 
---
Subject: Re:  namespace hides class definition

 --- Comment #1 from pinskia at gcc dot gnu dot org  2007-09-03 18:05 
 ---
 Yes and this correct.
 Though the error was wrong.
 On the trunk we get:
 t.cc:12: error: 'namespace C1 { }' redeclared as different kind of symbol
 t.cc:2: error: previous declaration of 'class C1'

... which was fixed by patch referenced in PR 30734 (PR 2708) on trunk, if 
you want to try/request a backport.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33287



[Bug c++/33287] namespace hides class definition

2007-09-03 Thread ilgb at livius dot net


--- Comment #3 from ilgb at livius dot net  2007-09-03 18:15 ---
it looks we are talking about different bugs, the error I get is different:

../src/a.cpp:26: error: 'C1' does not name a type

where the line 26 is the following:

C1 c;


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33287



[Bug c++/33287] namespace hides class definition

2007-09-03 Thread fang at csl dot cornell dot edu


--- Comment #4 from fang at csl dot cornell dot edu  2007-09-03 18:19 
---
Subject: Re:  namespace hides class definition

 --- Comment #3 from ilgb at livius dot net  2007-09-03 18:15 ---
 it looks we are talking about different bugs, the error I get is different:

 ../src/a.cpp:26: error: 'C1' does not name a type

 where the line 26 is the following:

C1 c;

Sorry to confuse, I meant that the new error message on the trunk was 
attributed to that patch I mentioned, not the bug you're currently seeing.

David Fang
Computer Systems Laboratory
Electrical  Computer Engineering
Cornell University
http://www.csl.cornell.edu/~fang/
-- (2400 baud? Netscape 3.0?? lynx??? No problem!)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33287



[Bug c++/33287] namespace hides class definition

2007-09-03 Thread eweddington at cso dot atmel dot com


--- Comment #5 from eweddington at cso dot atmel dot com  2007-09-04 04:02 
---
(In reply to comment #1)
 Yes and this correct.

Andrew,

Are you saying that this bug is invalid? If so, then it needs to be closed as
such.

Thanks


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33287