view gcc/testsuite/g++.dg/template/lookup15.C @ 19:2b5abeee2509 default tip

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents
children
line wrap: on
line source

// PR c++/94799 - member template function lookup fails.

template<typename>
struct M { void fn() { } };

M<int>* bar (int);
M<int> bar2 (int);

template<typename T>
struct X : M<T> {
  void xfn ()
  {
    this->template M<T>::fn ();
    bar((T)1)->template M<T>::fn ();
    bar2((T)1).template M<T>::fn ();
  }
};

int
main ()
{
  X<int> x;
  x.xfn();
}