gcc/testsuite/g++.dg/cpp0x/variadic-value1.C
raw| 1 | // PR c++/52796 |
| 2 | // { dg-do run { target c++11 } } |
| 3 | |
| 4 | typedef int int32_t __attribute__((mode (__SI__))); |
| 5 | |
| 6 | inline void *operator new(__SIZE_TYPE__ s, void *p) { return p; } |
| 7 | |
| 8 | struct A |
| 9 | { |
| 10 | int32_t i; |
| 11 | template<class... Ts> |
| 12 | A(Ts&&... ts): i(ts...) { } |
| 13 | }; |
| 14 | |
| 15 | static union { |
| 16 | unsigned char c[sizeof(A)]; |
| 17 | int32_t i; |
| 18 | }; |
| 19 | |
| 20 | int main() |
| 21 | { |
| 22 | i = 0xdeadbeef; |
| 23 | new(c) A; |
| 24 | if (i != 0) |
| 25 | __builtin_abort(); |
| 26 | } |