This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/100
- From: Wolfgang Bangerth <bangerth at ices dot utexas dot edu>
- To: nathan at gcc dot gnu dot org
- Cc: gcc-prs at gcc dot gnu dot org,
- Date: 5 May 2003 23:56:01 -0000
- Subject: Re: c++/100
- Reply-to: Wolfgang Bangerth <bangerth at ices dot utexas dot edu>
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/