This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch][c++/PR 31743]


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]