This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/16901] New: Broken warning about names from dependent bases after out-of-scope typedef
- From: "timb at bluearc dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Aug 2004 16:00:30 -0000
- Subject: [Bug c++/16901] New: Broken warning about names from dependent bases after out-of-scope typedef
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Try compiling this:
-----
template<class T> void f() { typedef typename T::X Y; }
class A { friend class Y; };
-----
The friend declaration generates two warnings:
test.cpp:2: warning: `class Y' declares a new type at namespace scope
test.cpp:2: warning: names from dependent base classes are not visible to
unqualified name lookup - to refer to the inherited type, say `class A::X'
The first is at least factually correct and potentially useful. The second is
strictly correct, but utterly irrelevant: there is no base class anywhere, and X
has absoutely nothing to do with A.
Furthermore, both warnings disappear if the typedef in f() is removed or
renamed. It should not be affecting things beyond its scope.
--
Summary: Broken warning about names from dependent bases after
out-of-scope typedef
Product: gcc
Version: 3.3.3
Status: UNCONFIRMED
Severity: minor
Priority: P1
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: timb at bluearc dot com
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i486-linux
GCC host triplet: i486-linux
GCC target triplet: i486-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16901