view gcc/testsuite/g++.dg/template/partial-order2.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

// CWG 2235

namespace X
{
  template<typename T> struct Const { typedef void type; };
  template<typename T> void f(T, typename Const<T>::type*); // T1
  template<typename T> void f(T, void *); // T2
  void g(void *p) { f(0, p); }
}

namespace Y
{
  struct A { A(int); };
  struct B { B(int); };

  template<typename T> void f(T, A);
  template<typename T> void f(T*, B);

  void g(int *p) { f(p, 0); }	// { dg-error "ambiguous" }
}