[PATCH] replace ICE with error for failed template deduction (PR 84355)

Jason Merrill jason@redhat.com
Mon Feb 19 04:39:00 GMT 2018


On Fri, Feb 16, 2018 at 4:33 PM, Martin Sebor <msebor@gmail.com> wrote:
> On 02/16/2018 07:04 AM, Jason Merrill wrote:
>>
>> On Thu, Feb 15, 2018 at 6:36 PM, Martin Sebor <msebor@gmail.com> wrote:
>>>
>>> A failed template deduction in template member of a template
>>> triggers an ICE with -std=c++17 due to what seems like
>>> a missing handling of invalid input.  Replacing
>>> the gcc_unreachable() call that causes the ICE with a return
>>> statement indicating the deduction failure eliminates the ICE
>>> and restores sane diagnostics.
>>
>>
>> Hmm, we really shouldn't have gotten there; that assert is checking
>> that when we see a TEMPLATE_*_PARM node in the template signature, it
>> corresponds to one of the actual parms of the template.  Sounds like
>> something is going wrong in build_deduction_guide.
>
>
> Are you suggesting that build_deduction_guide should fail somehow
> (it's not expected to fail right now) or that the guide it creates
> is wrong?

The latter.  Maybe we're handling T wrong somehow?  We shouldn't be
trying to deduce it.  In fact, we probably shouldn't be trying to
deduce arguments for 'b' until we instantiate A.

Jason



More information about the Gcc-patches mailing list