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: Sun, 01 Jul 2007 17:52:44 -0700
- Subject: Re: [patch][c++/PR 31743]
- References: <46796152.3010305@redhat.com> <467D6E8B.3070802@codesourcery.com> <46800DCA.7090800@redhat.com> <46840F6D.7040302@codesourcery.com> <46853963.5020400@redhat.com>
Dave Brolley wrote:
> Yes, this works. It also removes the need to call complete_type_or_else
> at all in build_new_1. So, here's my latest patch, ChangeLog and test
> case. The patch fixes the problem and causes no regressions in the test
> suite.
Great!
This comment isn't quite accurate:
> + /* PR 31743: Make sure the array type has a known size. */
> + if (!complete_type_or_else (type, NULL_TREE))
> + return error_mark_node;
because this check isn't just about array types. Better would be:
/* The type allocated must be complete. If the new-type-id was "T[N]"
then we are just checking that "T" is complete here, but that is
equivalent, since the value of "N" doesn't matter. */
(I'm not a fan of putting PR numbers in comments; the comment ought to
stand on itself.)
OK with that change; no need to retest.
Thanks,
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713