gcc/testsuite/g++.old-deja/g++.other/init17.C
raw| 1 | // { dg-do assemble } |
| 2 | |
| 3 | // Copyright (C) 2000 Free Software Foundation, Inc. |
| 4 | // Contributed by Nathan Sidwell 17 Jan 2001 <[email protected]> |
| 5 | |
| 6 | // Bug 1631. Default initialization of enumeral types did not convert to the |
| 7 | // enumeral type. |
| 8 | |
| 9 | enum X { alpha, beta }; |
| 10 | |
| 11 | void f(void *ptr) |
| 12 | { |
| 13 | X y = X (); |
| 14 | X y1 (0); // { dg-error "" } cannot convert |
| 15 | X y2 = X (0); |
| 16 | X *x = new X (); |
| 17 | X *x2 = new X (0); // { dg-error "" } cannot convert |
| 18 | } |