1// PR c++/40306, c++/40307
2// { dg-do run { target c++11 } }
3
4template< typename T >
5struct test {
6   test run() {
7      auto tmp = *this;
8      return tmp;
9   }
10   test run_pass() {
11      test tmp( *this );
12      return tmp;
13   }
14
15   test run_fail() {
16      auto tmp( *this );
17      return tmp;
18   }
19};
20
21int main()
22{
23   test<int> x;
24   x.run();
25   x.run_pass();
26   x.run_fail();
27   return 0;
28}
29