* decl.c (make_typename_type): s/parameters/arguments/.
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / sfinae37.C
blobe89106aac34060513ecf9d17e2b6ad70176730c5
1 // PR c++/51213
2 // { dg-do compile { target c++11 } }
4 class C {
5   typedef int type;
6 };
8 template<int>
9 struct I;
11 template<>
12 struct I<2> { };
14 template<class T, class = typename T::type>
15 auto f(int) -> char;
17 template<class>
18 auto f(...) -> char (&)[2];
20 static_assert(sizeof(f<C>(0)) == 2, "Ouch");
22 typedef int testf[sizeof(f<C>(0)) == 2 ? 1 : -1];
24 I<sizeof(f<C>(0))> vf;
26 template<class T>
27 auto g(int) -> decltype(typename T::type(), char());
29 template<class>
30 auto g(...) -> char (&)[2];
32 static_assert(sizeof(g<C>(0)) == 2, "Ouch");
34 typedef int testg[sizeof(g<C>(0)) == 2 ? 1 : -1];
36 I<sizeof(g<C>(0))> vg;