* decl.c (make_typename_type): s/parameters/arguments/.
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / decltype21.C
blobe4dc2011e390ac02fe315c6fc978c1f3d7a11ff6
1 // PR c++/6709 (DR 743)
2 // PR c++/42603 (DR 950)
3 // { dg-do compile { target c++11 } }
5 template <class T>
6 T make();
8 struct p { typedef int t; };
9 struct c : decltype(make<p>()) {};
11 decltype(make<p>())::t t;
13 // PR c++/49823
15 template < typename T >
16 auto f( const T &x )
17   -> typename decltype( x )::type; // ICE on here
19 template < typename T >
20 typename decltype( T{} )::type // ICE on here
21 f( T );
23 template < typename T >
24 void f( T x )
25 { typename decltype( x )::type t; } // ICE on here
27 // Negative tests
29 int f();
30 decltype(f())::t t2;            // { dg-error "not a class" }
32 struct D: decltype(f()) { };    // { dg-error "not a class" }
34 // { dg-prune-output "expected initializer" }