This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ Patch] PR 85028 ("[8 Regression] ICE on invalid C++ code: in tsubst_default_argument, at cp/pt.c:12340")
- 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: Wed, 28 Mar 2018 10:28:52 -0400
- Subject: Re: [C++ Patch] PR 85028 ("[8 Regression] ICE on invalid C++ code: in tsubst_default_argument, at cp/pt.c:12340")
- References: <5c61f1e5-5695-54d3-91e4-72f71cf39667@oracle.com>
OK.
On Wed, Mar 28, 2018 at 8:25 AM, Paolo Carlini <paolo.carlini@oracle.com> wrote:
> Hi,
>
> as I said in the audit trail, in its way this error recovery issue is
> somewhat interesting: Jason's r251422 added some code at the beginning of
> tsubst_default_argument, included the gcc_assert that triggers here. In
> fact, parmtype is only used in the assertion thus the error recovery check
> could be moved inside the assertion, something like (appears to also pass
> testing, lightly tested, so far):
>
> gcc_assert (parmtype == error_mark_node ||
> same_type_ignoring_top_level_qualifiers_p (type, parmtype));
>
> and for this bug we would be back to the gcc-7 status, thus we would not ICE
> and we would issue *2* errors, one for the parameter and then one more for
> the default argument itself, at instantiation time. In fact, some other
> compilers also do that. Or, as I have below, we can return early, after the
> first error. Tested x86_64-linux.
>
> Thanks, Paolo.
>
> ///////////////////
>