]> gcc.gnu.org Git - gcc.git/blame - gcc/testsuite/g++.dg/cpp0x/decltype21.C
PR c++/92590 - wrong handling of inherited default ctor.
[gcc.git] / gcc / testsuite / g++.dg / cpp0x / decltype21.C
CommitLineData
34429675
JM
1// PR c++/6709 (DR 743)
2// PR c++/42603 (DR 950)
4b2e63de 3// { dg-do compile { target c++11 } }
34429675
JM
4
5template <class T>
6T make();
7
8struct p { typedef int t; };
9struct c : decltype(make<p>()) {};
10
11decltype(make<p>())::t t;
12
3bb4eb1c
JM
13// PR c++/49823
14
15template < typename T >
16auto f( const T &x )
17 -> typename decltype( x )::type; // ICE on here
18
19template < typename T >
20typename decltype( T{} )::type // ICE on here
21f( T );
22
23template < typename T >
24void f( T x )
25{ typename decltype( x )::type t; } // ICE on here
26
27// Negative tests
28
34429675
JM
29int f();
30decltype(f())::t t2; // { dg-error "not a class" }
31
32struct D: decltype(f()) { }; // { dg-error "not a class" }
33
34// { dg-prune-output "expected initializer" }
This page took 5.432894 seconds and 5 git commands to generate.