Debian Codegraph @

gcc/testsuite/g++.dg/cpp2a/fn-template1.C

raw
1 // P0846R0
2 // { dg-do compile }
3 // { dg-options "-std=c++2a" }
4
5 int h;
6 void g();
7 void e();
8 void e(int);
9 void e(int, int);
10
11 namespace N {
12 struct A { };
13 template <class T> int f(T);
14 template <class T> int g(T);
15 template <class T> int h(T);
16 template <class T> int e(T);
17 }
18
19 int v = e<N::A>(N::A());
20 int x = f<N::A>(N::A());
21 int y = g<N::A>(N::A());
22 int z = h<N::A>(N::A()); // { dg-error "expected" }
23
24 template<class>
25 void fn ()
26 {
27 int v = e<N::A>(N::A());
28 int x = f<N::A>(N::A());
29 int y = g<N::A>(N::A());
30 int z = h<N::A>(N::A()); // { dg-error "expected" }
31 }
32
33 void
34 test ()
35 {
36 fn<int>();
37 }