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: [C++ Patch] PR 34776


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


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