Template + dependent name

$ 14.6.2 / 3 - "In the definition of a class template or member of a class template, if the base class of the class template depends on the template parameter, the area of ​​the base class is not considered with an unqualified name to search either at the point of definition of the class template or member, or during the creation of the template or class member. "

Accordingly, a call 'f(0)'to 'D::g'should call 'B:f'. However, gcc (IdeOne) gives an ambiguit error.

Is this a bug in gcc? Como compiles it perfectly

template<class T, class U> struct A{
   template<class A, class B> A f(B b){A a; return a;}
};

struct B{
   double f(double d){return 0.0;}
};

template<class T, class U> struct D : A<T, U>, B{
   void g(){f(0);}
};

int main(){
   D<double, double> d;
   d.g();
}
+5
source share
1 answer

, GCC. , GCC 4.4.0. , , , .

+5

All Articles