]> gcc.gnu.org Git - gcc.git/blame - gcc/testsuite/g++.dg/cpp0x/sfinae37.C
PR c++/92590 - wrong handling of inherited default ctor.
[gcc.git] / gcc / testsuite / g++.dg / cpp0x / sfinae37.C
CommitLineData
0e69fdf0
PC
1// PR c++/51213
2// { dg-do compile { target c++11 } }
3
4class C {
5 typedef int type;
6};
7
742b0bcd
JM
8template<int>
9struct I;
10
11template<>
12struct I<2> { };
13
0e69fdf0
PC
14template<class T, class = typename T::type>
15auto f(int) -> char;
16
17template<class>
18auto f(...) -> char (&)[2];
19
20static_assert(sizeof(f<C>(0)) == 2, "Ouch");
21
742b0bcd
JM
22typedef int testf[sizeof(f<C>(0)) == 2 ? 1 : -1];
23
24I<sizeof(f<C>(0))> vf;
25
0e69fdf0
PC
26template<class T>
27auto g(int) -> decltype(typename T::type(), char());
28
29template<class>
30auto g(...) -> char (&)[2];
31
32static_assert(sizeof(g<C>(0)) == 2, "Ouch");
742b0bcd
JM
33
34typedef int testg[sizeof(g<C>(0)) == 2 ? 1 : -1];
35
36I<sizeof(g<C>(0))> vg;
This page took 5.370314 seconds and 5 git commands to generate.