gcc/testsuite/g++.dg/cpp0x/nullptr32.C
raw| 1 | // PR c++/63942 |
| 2 | // A mangling alias for the first constructor was conflicting with the second. |
| 3 | // { dg-do compile { target c++11 } } |
| 4 | // { dg-options "-fno-inline" } |
| 5 | |
| 6 | int i; |
| 7 | template <class T> struct A |
| 8 | { |
| 9 | A(const T&) { i = 42; } |
| 10 | A(const A&) { i = 36; } |
| 11 | }; |
| 12 | |
| 13 | typedef A<decltype(nullptr)> An; |
| 14 | |
| 15 | int main() |
| 16 | { |
| 17 | An a (nullptr); |
| 18 | if (i != 42) __builtin_abort(); |
| 19 | An a2 (a); |
| 20 | if (i != 36) __builtin_abort(); |
| 21 | } |