blob: 5c1c4eb09defa091c5c9a63e957a4f7663248584 (
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
|
// { dg-do run { target c++17 } }
#include <new>
struct alignas(64) A {
int i;
A() { throw 42; }
};
struct B { int i; } b;
void *operator new (std::size_t s, std::align_val_t a, B b)
{
return operator new (s, a);
}
bool deleted = false;
void operator delete (void *p, std::align_val_t, B)
{
deleted = true;
}
int main()
{
try {
A *p = new (b) A;
__builtin_abort ();
} catch (...) {}
if (!deleted)
__builtin_abort ();
}
|