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];};
15 one foo(const A&) {return one();}
16 two foo(A&&) {return two();}
18 template<typename _Tp>
21 { return static_cast<_Tp&&>(__t); }
23 A&& source() {static A a; return movel(a);}
27 sa<sizeof(foo(source())) == 2 * sizeof(long)> t1;