This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ Patch] ("[7/8 Regression] ICE with failed class template argument deduction because of invalid template parameter")
- From: Jason Merrill <jason at redhat dot com>
- To: Paolo Carlini <paolo dot carlini at oracle dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 3 Apr 2018 11:39:03 -0400
- Subject: Re: [C++ Patch] ("[7/8 Regression] ICE with failed class template argument deduction because of invalid template parameter")
- References: <05885dfd-8195-0d61-e1ff-156b2631712a@oracle.com>
OK.
On Tue, Apr 3, 2018 at 5:02 AM, Paolo Carlini <paolo.carlini@oracle.com> wrote:
> Hi,
>
> the reason why we ICE here is very simple: we pass an error_mark_node
> generated in cp_parser_template_parameter_list to rewrite_template_parm
> which ICEs (via get_template_parm_index). I believe it makes sense to
> robustify the latter like all the other functions involved in
> build_deduction_guide. The next, error recovery quality, issue is whether or
> not we still want to produce diagnostic about class template argument
> deduction failing: today I noticed - somewhat surprisingly - that some
> compilers still do that (however the diagnostic is more terse: eg, one
> additional error and two notes, not two errors and five notes!). I had
> tested the below which suppresses those additional errors by returning
> error_mark_node from build_deduction_guide if one of those parsing-time
> error_mark_nodes is encountered in the build_deduction_guide loop - and lays
> out a bit of infrastructure.
>
> Tested x86_64-linux.
>
> Thanks, Paolo.
>
> ////////////////
>