gcc/testsuite/g++.old-deja/g++.law/ctors13.C
raw| 1 | // { dg-do assemble } |
| 2 | // { dg-skip-if "requires hosted libstdc++ for iostream" { ! hostedlib } } |
| 3 | // GROUPS passed constructors |
| 4 | #include <iostream> |
| 5 | |
| 6 | class A { |
| 7 | A() {} // private constructor// { dg-message "" } .* |
| 8 | }; |
| 9 | |
| 10 | int main() { |
| 11 | A* a = new A();// { dg-error "" } .* |
| 12 | if (a) { |
| 13 | std::cout << "a != NULL\n"; |
| 14 | } else { |
| 15 | std::cout << "a == NULL\n"; |
| 16 | } |
| 17 | } |
| 18 | |
| 19 |