This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ Patch] PR 34776
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Paolo Carlini <pcarlini at suse dot de>
- Cc: Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 20 Jan 2008 14:30:01 -0500
- Subject: Re: [C++ Patch] PR 34776
- References: <478F9CD3.50109@suse.de>
Paolo Carlini wrote:
> I have this tiny patch, which just avoids calling constructor_name_p
> when doesn't make sense. Alternately, would also work robustifying
> constructor_name_p itself, but I'm not sure we want to do that because
> most uses are guaranteed safe,
I think that, as you say, it makes no sense to call constructor_name_p
when a non-class type. So, doing the check where you're doing it is
fine. OK for mainline.
It's not a requirement for acceptance, but I think it would be even
better to also (a) add a "gcc_assert (CLASS_TYPE_P (type))" to
constructor_name_p, and (b) and change the documentation for
constructor_name_p to say:
... TYPE, which must be a class type.
Those changes are pre-approved, provided they pass testing.
Thanks,
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713