blob: 2acfa98364b495de85adb0374fdaaf14213acd53 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
// { dg-do compile { target c++14 } }
struct A
{
constexpr A(int) { }
};
struct B: A {
constexpr B(int i): A(i) { }
constexpr B(const B& b): A(b) { }
};
struct C {
B b;
constexpr C(int i): b(i) { }
constexpr C(const C&c): b(c.b) {}
};
constexpr int f()
{
C b1{42};
C b2{b1};
b2.b;
return 42;
}
constexpr int i = f();
|