Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/cpp0x/auto14.C @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 1 // PR c++/40306, c++/40307 |
2 // { dg-do run { target c++11 } } | |
3 | |
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 } | |
14 | |
15 test run_fail() { | |
16 auto tmp( *this ); | |
17 return tmp; | |
18 } | |
19 }; | |
20 | |
21 int main() | |
22 { | |
23 test<int> x; | |
24 x.run(); | |
25 x.run_pass(); | |
26 x.run_fail(); | |
27 return 0; | |
28 } |