This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
C++ PATCH: Fix PR 266
- To: gcc-patches at gcc dot gnu dot org
- Subject: C++ PATCH: Fix PR 266
- From: Mark Mitchell <mark at codesourcery dot com>
- Date: Sat, 17 Feb 2001 21:54:05 -0800
- Organization: CodeSourcery, LLC
Per a Defect Report to the standard, we're supposed to accept:
new T[E];
where E has an enumeration type.
Tested on i686-pc-linux-gnu, applied on the mainline.
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com
2001-02-17 Mark Mitchell <mark@codesourcery.com>
* init.c (build_new): Allow enumeration types for the array-bounds
in a direct-new-declarator.
Index: cp/init.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/init.c,v
retrieving revision 1.235
diff -c -p -r1.235 init.c
*** init.c 2001/02/17 00:12:44 1.235
--- init.c 2001/02/18 05:47:15
*************** build_new (placement, decl, init, use_gl
*** 2081,2088 ****
}
else
{
! int flags = pedantic ? WANT_INT : (WANT_INT | WANT_ENUM);
! if (build_expr_type_conversion (flags, this_nelts, 0)
== NULL_TREE)
pedwarn ("size in array new must have integral type");
--- 2081,2088 ----
}
else
{
! if (build_expr_type_conversion (WANT_INT | WANT_ENUM,
! this_nelts, 0)
== NULL_TREE)
pedwarn ("size in array new must have integral type");