(I first posted this code to PR5660 but it's apparently a separate issue)

   template <typename T>
     struct A
     {
         typedef T Type;
         void f(Type) {}
     };

   template <typename T>
     struct B : A<T>
     {
         typedef typename A<T>::Type Type;
         void ff(Type t) { f(t); }         // XXX
     };

   template struct B<int>;

This should fail to compile, according to 14.6.2/3, but 3.4 - 4.1 (and probably
earlier) accept it.

If A::f and the call to it are changed to take no arguments (so that f is not a
dependent name) then it fails, so it is apparently only at instantiation that
the base class scope is examined.

-- 
           Summary: Base class scope examined during unqualified name lookup
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: redi at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org


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

Reply via email to