[C++ Patch/RFC] PR 77752

Jason Merrill jason@redhat.com
Mon Mar 20 21:10:00 GMT 2017


On Fri, Mar 10, 2017 at 5:38 PM, Paolo Carlini <paolo.carlini@oracle.com> wrote:
> Hi,
> On 10/03/2017 16:57, Jason Merrill wrote:
>> On Fri, Mar 10, 2017 at 9:58 AM, Paolo Carlini <paolo.carlini@oracle.com>
>> wrote:
>>> As such, the broken declaration cannot be rejected by the code we have in
>>> finish_struct, something must happen earlier than that. It seems to me
>>> that
>>> xref_tag_1 can be a good place, per the below patchlet, which passes
>>> testing
>>> on x86_64-linux. I briefly wondered if making is_std_init_list stricter
>>> would make sense instead, but I don't think so (consistently with the
>>> trail
>>> of c++/60848 too): I believe that by the time we use is_std_init_list in
>>> the
>>> internals we want something as simple as possible, we are assuming that
>>> broken, fake, std::initializer_list aren't around in the translation
>>> unit.
>>> In terms of details, I also wondered if CLASSTYPE_IS_TEMPLATE would make
>>> for
>>> a better check, but seems unnecessarily more complex. Also, in principle,
>>> we
>>> may want to have an even stricter check at declaration time (how many
>>> template parameters, etc) but that seems overkilling and I don't think we
>>> are risking ICEs because of that.
>> I agree with all of this.  How about in pushtag_1 instead, where we
>> can return error_mark_node instead of aborting?
> Sure. In that case the testcase for that older issue also requires
> adjusting. The below passes testing, anyway.
> Thanks,
> Paolo.
> ////////////////////

More information about the Gcc-patches mailing list