PR c++/86728 - C variadic generic lambda.
[official-gcc.git] / gcc / testsuite / g++.dg / template / error38.C
blob6c25b9f9c0fa193479f94d13252d9c946267a814
1 // Testcase for printing typename/typedef bindings as well as template args
2 // in diagnostics (PR c++/25185)
4 template <class T>
5 struct A {
6   typename T::type f();         // { dg-message "typename T::type = void*" }
7   void f(int i = 0);            // { dg-message "" }
9   typedef typename T::type mytype;
10   mytype g();                   // { dg-message "mytype = void*" }
11   void g(int i = 0);            // { dg-message "" }
14 struct B
16   typedef void* type;
19 // Also make sure that deduced template arguments get canonicalized.
21 template <class T>
22 void f (T &t);                  // { dg-message "T = int" }
24 template <class T>
25 void f (T &t, int = 0);         // { dg-message "" }
27 typedef int myint;
28 myint i;
29 myint *p;
31 int main()
33   A<B> a;
34   a.f();                        // { dg-error "" }
35   a.g();                        // { dg-error "" }
37   f(i);                         // { dg-error "" }
38   f(p);                         // { dg-error "" }