Merge from mainline (gomp-merge-2005-02-26).
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.other / init17.C
blob32b2f1d60234ec0860f3d3e4628d61e2987587cb
1 // { dg-do assemble  }
3 // Copyright (C) 2000 Free Software Foundation, Inc.
4 // Contributed by Nathan Sidwell 17 Jan 2001 <nathan@codesourcery.com>
6 // Bug 1631. Default initialization of enumeral types did not convert to the
7 // enumeral type.
9 enum X { alpha, beta };
11 void f(void *ptr)
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