1// I, Howard Hinnant, hereby place this code in the public domain.
2
3// Test: Named rvalue references are treated as lvalues.
4
5// { dg-do compile { target c++11 } }
6// { dg-skip-if "packed attribute missing for struct one" { "epiphany-*-*" } { "*" } { "" } }
7
8template <bool> struct sa;
9template <> struct sa<true> {};
10
11struct one   {long x[1];};
12struct two   {long x[2];};
13
14struct A {};
15
16one foo(const A&) {return one();}
17two foo(A&&)      {return two();}
18
19int test1(A&& a)
20{
21    sa<sizeof(foo(a)) == 1 * sizeof(long)> t1;
22    return 0;
23}
24
25int main()
26{
27    return test1(A());
28}
29