c++: prvalue of array type [PR111286]
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / auto14.C
blob0ada26544683921d97dd5ca0fb4f2f8e02024228
1 // PR c++/40306, c++/40307
2 // { dg-do run { target c++11 } }
4 template< typename T >
5 struct test {
6    test run() {
7       auto tmp = *this;
8       return tmp;
9    }
10    test run_pass() {
11       test tmp( *this );
12       return tmp;
13    }
15    test run_fail() {
16       auto tmp( *this );
17       return tmp;
18    }
21 int main()
23    test<int> x;
24    x.run();
25    x.run_pass();
26    x.run_fail();
27    return 0;