view gcc/testsuite/g++.old-deja/g++.other/init17.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
line wrap: on
line source

// { dg-do assemble  }

// Copyright (C) 2000 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 17 Jan 2001 <nathan@codesourcery.com>

// Bug 1631. Default initialization of enumeral types did not convert to the
// enumeral type.

enum X { alpha, beta };

void f(void *ptr)
{
  X y = X ();
  X y1 (0);                   // { dg-error "" } cannot convert
  X y2 = X (0);
  X *x = new X ();
  X *x2 = new X (0);          // { dg-error "" } cannot convert
}