This is the mail archive of the gcc-prs@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]

Re: c++/100


The following reply was made to PR c++/100; it has been noted by GNATS.

From: Wolfgang Bangerth <bangerth@ices.utexas.edu>
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: Re: c++/100
Date: Mon, 5 May 2003 18:50:26 -0500 (CDT)

 For reference again:
 ----------------------------
 class X {};
 
 namespace NS {
    typedef X X;
 }
 
 using namespace NS;
 
 void foo () {
    X x;
 }
 ---------------------------
 
 Per 7.3.4.2, name lookup for X is ambiguous since the namespace into which 
 the using directive "injects" NS::X is the global one, which is the same 
 in which class X is declared. That NS::X is a typedef pointing to ::X is 
 irrelevant in my opinion.
 
 What _is_ relevant, though, is that the error message we presently get is 
 really not helpful:
 
 g/x> /home/bangerth/bin/gcc-3.4-pre/bin/gcc -W -Wall -c x.cc
 x.cc: In function `void foo()':
 x.cc:10: error: `X' does not name a type
 
 W.
 
 -------------------------------------------------------------------------
 Wolfgang Bangerth              email:            bangerth@ices.utexas.edu
                                www: http://www.ices.utexas.edu/~bangerth/
 
 


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