This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/20234] incorrect error: class has not been declared


------- Additional Comments From bangerth at dealii dot org  2005-02-28 15:47 -------
Kriang is our resident expert on this. A shorter testcase is this: 
------------------- 
class C; 
 
namespace NS { 
  class A { 
      friend class C; 
  }; 
} 
using namespace NS; 
 
class C {}; 
C c; 
---------------------------- 
g/x> /home/bangerth/bin/gcc-3.4*/bin/c++ -c x.cc 
 
g/x> /home/bangerth/bin/gcc-4.0-pre/bin/c++ -c x.cc 
x.cc:11: error: ?C? does not name a type 
 
g/x> icc -Xc -ansi -c x.cc 
 
The error is really that gcc thinks that the class is ambiguous -- the 
fact that it says something completely different is a second symptom of 
really bad error messages, but this case is covered in another PR. The 
question here is: is the use of the name 'C' ambiguous or is it not. 
 
W. 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lerdsuwa at gcc dot gnu dot
                   |                            |org


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]