aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/auto14.C
blob: cb2c4e0351a141c2c379f7daec211ada4c0697f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// PR c++/40306, c++/40307
// { dg-options "-std=c++0x" }
// { dg-do run }

template< typename T >
struct test {
   test run() {
      auto tmp = *this;
      return tmp;
   }
   test run_pass() {
      test tmp( *this );
      return tmp;
   }

   test run_fail() {
      auto tmp( *this );
      return tmp;
   }
};

int main()
{
   test<int> x;
   x.run();
   x.run_pass();
   x.run_fail();
   return 0;
}