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++/16901] New: Broken warning about names from dependent bases after out-of-scope typedef


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


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