Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/cpp1z/elide1.C @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children | 84e7813d76e9 |
rev | line source |
---|---|
111 | 1 // { dg-options -std=c++17 } |
2 | |
3 struct A | |
4 { | |
5 A(); | |
6 A(const A&) = delete; | |
7 }; | |
8 | |
9 bool b; | |
10 A a = A(); | |
11 A a1 = b ? A() : A(); | |
12 A a2 = (42, A()); | |
13 | |
14 A f(); | |
15 A a3 = f(); | |
16 A a4 = b ? A() : f(); | |
17 | |
18 void g(A); | |
19 A f() { | |
20 g(A()); | |
21 if (b) | |
22 throw A(); | |
23 else | |
24 return A(); | |
25 } | |
26 | |
27 A* ap = new A(f()); | |
28 | |
29 struct B { | |
30 A a; | |
31 B(): a(A()) {} | |
32 }; |