Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/cpp1z/elide1.C @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
131 | 1 // { dg-do compile { target c++17 } } |
111 | 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 }; |