Debian Codegraph @

gcc/testsuite/g++.dg/template/param6.C

raw
1 // PR c++/61355
2 // Verify we perform array-to-pointer and function-to-pointer conversion
3 // on the substituted/deduced type of an NTTP.
4
5 int f();
6 int p[5];
7
8 namespace cpp98 {
9 template<class T, T> struct X;
10 typedef X<int(), f> ty1;
11 typedef X<int[5], p> ty2;
12 }
13
14 namespace cpp11 {
15 #if __cpp_variadic_templates
16 template<class T, T...> struct X;
17 using ty1 = X<int(), f>;
18 using ty2 = X<int[5], p>;
19 #endif
20 }
21
22 namespace cpp17 {
23 #if __cpp_nontype_template_parameter_auto
24 template<decltype(auto)> struct X;
25 using ty1 = X<f>;
26 using ty2 = X<p>;
27
28 template<decltype(auto)...> struct Y;
29 using ty3 = Y<f>;
30 using ty4 = Y<p>;
31 #endif
32 }