* decl.c (make_typename_type): s/parameters/arguments/.
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / decltype5.C
blob3842e09c134d537fabb370651eaec9a9e1285bdf
1 // { dg-do compile { target c++11 } }
3 template<typename T, typename U> 
4 struct is_same 
6   static const bool value = false;
7 };
9 template<typename T>
10 struct is_same<T, T>
12   static const bool value = true;
15 #define CHECK_DECLTYPE(DECLTYPE,RESULT) \
16   static_assert(is_same< DECLTYPE , RESULT >::value, #RESULT)
18 template<typename F> F create_a();
20 template<typename F, typename T1>
21 decltype(create_a<F&>()(create_a<const T1&>())) forward(F f, const T1& a1)
23   return f(a1);
26 struct identity {
27   template<typename T>
28   const T& operator()(const T& x) { return x; }
32 identity id;
33 int i;
34 float f;
36 CHECK_DECLTYPE(decltype(forward(id, i)), const int&);
37 CHECK_DECLTYPE(decltype(forward(id, f)), const float&);