This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch][c++/PR 31743]
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Dave Brolley <brolley at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sat, 23 Jun 2007 13:03:39 -0600
- Subject: Re: [patch][c++/PR 31743]
- References: <46796152.3010305@redhat.com>
Dave Brolley wrote:
> I posted this patch to bugzilla but wasn't aware (until now) that I also
> needed to post it here. It fixes c++/PR 31743.
Thanks for working on this. A cleaner fix would be to but a call to
require_complete_type in build_new (rather than build_new_1).
The TYPE argument to build_new is either the type being allocated, or
the type of the array elements. In either case, it must be a complete
type. So, after the other checks (for REFERENCE_TYPE and FUNCTION_TYPE)
in build_new, you could just do:
type = require_complete_type (type);
if (type == error_mark_node)
return error_mark_node;
Then, remove the complete_type_or_else call from build_new_1. (The only
caller of build_new_1 is build_new.)
Please also include a testcase with your submission.
Thanks,
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713