Fortran: Fix PR 47485.
[gcc.git] / gcc / testsuite / g++.dg / diagnostic / pr100716.C
blobe3b0ac24b31aa9258a83e08978d9af83391a7618
1 // { dg-options "-fpretty-templates" }
3 template<typename T>
4   struct A
5   {
6     template<typename U>
7       void f() {} // { dg-line Af }
9     template<typename U>
10       void g(U) {} // { dg-line Ag }
11   };
13 template<typename T>
14   struct B
15   {
16     template<typename U>
17       void f(U) {} // { dg-line Bf }
19     template<typename U>
20       void g(U, T) {} // { dg-line Bg }
21   };
23 struct C
25   template<typename U>
26     void f(U) {} // { dg-line Cf }
28   template<typename U>
29     void g() {} // { dg-line Cg }
32 int main()
34   A<int>().f(0); // { dg-error "no matching function for call to 'A<int>::f\\(int\\)'" }
35   // { dg-message "candidate 1: 'template<class U> void A<T>::f\\(\\) \\\[with T = int\\\]'" "" { target *-*-* } Af }
37   A<int>().g(); // { dg-error "no matching function for call to 'A<int>::g\\(\\)'" }
38   // { dg-message "candidate 1: 'template<class U> void A<T>::g\\(U\\) \\\[with T = int\\\]'" "" { target *-*-* } Ag }
40   B<int>().f(); // { dg-error "no matching function for call to 'B<int>::f\\(\\)'" }
41   // { dg-message "candidate 1: 'template<class U> void B<T>::f\\(U\\) \\\[with T = int\\\]'" "" { target *-*-* } Bf }
43   B<int>().g(); // { dg-error "no matching function for call to 'B<int>::g\\(\\)'" }
44   // { dg-message "candidate 1: 'template<class U> void B<T>::g\\(U, T\\) \\\[with T = int\\\]'" "" { target *-*-* } Bg }
46   B<float>().g(0); // { dg-error "no matching function for call to 'B<float>::g\\(int\\)'" }
47   // { dg-message "candidate 1: 'template<class U> void B<T>::g\\(U, T\\) \\\[with T = float\\\]'" "" { target *-*-* } Bg }
49   C().f(); // { dg-error "no matching function for call to 'C::f\\(\\)'" }
50   // { dg-message "candidate 1: 'template<class U> void C::f\\(U\\)'" "" { target *-*-* } Cf }
52   C().g(0); // { dg-error "no matching function for call to 'C::g\\(int\\)'" }
53   // { dg-message "candidate 1: 'template<class U> void C::g\\(\\)'" "" { target *-*-* } Cg }