comparison gcc/testsuite/g++.dg/cpp1y/constexpr-90383-2.C @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents
children
comparison
equal deleted inserted replaced
131:84e7813d76e9 145:1830386684a0
1 // PR c++/90383
2 // { dg-do run { target c++14 } }
3 // { dg-options "-O2" }
4
5 extern "C" void abort ();
6 struct alignas(8) A { constexpr A (bool x) : a(x) {} A () = default; bool a; };
7 struct B { A b; };
8
9 constexpr bool
10 foo ()
11 {
12 B w{A (true)};
13 w.b = A (true);
14 return w.b.a;
15 }
16
17 int
18 main ()
19 {
20 if (!foo ())
21 abort ();
22 }