* decl.c (make_typename_type): s/parameters/arguments/.
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / unnamed_refs.C
blobc1b94bb5cae339a17679b3e20884ae433b9ad0f3
1 // I, Howard Hinnant, hereby place this code in the public domain.
3 // Test: Unamed rvalue references are treated as lvalues.
5 // { dg-do compile { target c++11 } }
7 template <bool> struct sa;
8 template <> struct sa<true> {};
10 struct one   {long x[1];};
11 struct two   {long x[2];};
13 struct A {};
15 one foo(const A&) {return one();}
16 two foo(A&&)      {return two();}
18 template<typename _Tp>
19 inline _Tp&&
20 movel(_Tp& __t)
21 { return static_cast<_Tp&&>(__t); }
23 A&& source() {static A a; return movel(a);}
25 int test1()
27     sa<sizeof(foo(source())) == 2 * sizeof(long)> t1;
28     return 0;
31 int main()
33     return test1();