Debian Codegraph @

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

raw
1 // P0846R0
2 // { dg-do run }
3 // { dg-options "-std=c++2a" }
4
5 void g();
6 void e();
7 void e(int);
8 void e(int, int);
9
10 namespace N {
11 struct A { };
12 template <class T> int f(T) { return 1; }
13 template <class T> int g(T) { return 2; }
14 template <class T> int e(T) { return 3; }
15 }
16
17 int
18 main ()
19 {
20 int v = e<N::A>(N::A());
21 if (v != 3)
22 __builtin_abort ();
23 int x = f<N::A>(N::A());
24 if (x != 1)
25 __builtin_abort ();
26 int y = g<N::A>(N::A());
27 if (y != 2)
28 __builtin_abort ();
29 }