Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.old-deja/g++.mike/ref1.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 // { dg-do run } |
2 int count; | |
3 | |
4 struct base { | |
5 base () { ++count; } | |
6 ~base () { --count; } | |
7 base(const base&o) { ++count; } | |
8 }; | |
9 | |
10 base base_returning_function (); | |
11 | |
12 const base& base_ref = base_returning_function (); | |
13 | |
14 int main () { | |
15 if (count != 1) | |
16 return 1; | |
17 } | |
18 | |
19 base base_returning_function () { | |
20 base local_base_object; | |
21 return local_base_object; | |
22 } |