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

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-10-22 
13:29:19 UTC ---
I noticed this while analysing PR 42356, the missing template argument makes it
much harder to see why name lookup results are ambiguous

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

struct B : A<int>, A<void> { };

int main() {
  B a;
  a.f();
}

f.C: In function ‘int main()’:
f.C:11:5: error: request for member ‘f’ is ambiguous
f.C:4:12: error: candidates are: template<class U> void A::f() [with U = U, T =
void]
f.C:4:12: error:                 template<class U> void A::f() [with U = U, T =
int]

Because T isn't shown in the signature it's not immediately obvious that name
lookup found A<void>::f and A<int>::f in different base classes.

Reply via email to