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++/50828] class template parameter not printed for member function template in candidate list


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.


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