blob: 3165863c6391590e09dde6743c95746507dc3b6c (
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
28
29
30
31
32
|
// Make sure that A's destructor doesn't affect constexpr
// or exception-spec on D's default constructor.
// { dg-do compile { target c++11 } }
struct A {
constexpr A() noexcept: i(0) { }
int i;
~A() noexcept(false);
};
struct B: A { };
// Should get static initialization, so no constructor call.
// { dg-final { scan-assembler-not "_ZN1BC1Ev" } }
B b;
struct C { C() noexcept; ~C() noexcept(false); };
struct D: C { };
extern D d;
void *operator new(__SIZE_TYPE__, void*) noexcept;
#define SA(X) static_assert((X),#X)
SA(noexcept(new (&d) D));
struct E: virtual C { };
extern E e;
SA(noexcept (new (&e) E));
struct F { C c; };
extern F f;
SA(noexcept (new (&f) F));
|