blob: b27ac34692f2b1a3e09920e0173114de6464d986 (
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
|
// PR c++/52796
// { dg-do run { target c++11 } }
typedef int int32_t __attribute__((mode (__SI__)));
inline void *operator new(__SIZE_TYPE__ s, void *p) { return p; }
struct A
{
int32_t i;
template<class... Ts>
A(Ts&&... ts): i(ts...) { }
};
static union {
unsigned char c[sizeof(A)];
int32_t i;
};
int main()
{
i = 0xdeadbeef;
new(c) A;
if (i != 0)
__builtin_abort();
}
|