This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: PR c++/36411: [4.4 regression] ICE with invalid template template parameter
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 23 Feb 2009 14:03:12 -0800
- Subject: Re: PATCH: PR c++/36411: [4.4 regression] ICE with invalid template template parameter
- References: <20090223172242.GA14403@lucon.org> <49A31379.4060903@redhat.com>
On Mon, Feb 23, 2009 at 1:22 PM, Jason Merrill <jason@redhat.com> wrote:
> H.J. Lu wrote:
>>
>> parm = TREE_VALUE (TREE_VEC_ELT (parm_parms, nparms - 1));
>> + if (parm == error_mark_node)
>> + return 0;
>
> Please check for error_mark_node before taking the TREE_VALUE, as the loops
> lower in the function do. Volker's patch also has the problem of taking
> TREE_VALUE of an error_mark_node, which is undefined.
>
> Jason
>
>
The current code is
if (TREE_VEC_ELT (parm_parms, nparms - 1) != error_mark_node)
{
parm = TREE_VALUE (TREE_VEC_ELT (parm_parms, nparms - 1));
....
We check error_mark_node on TREE_VEC_ELT. But we missed
error_mark_node on TREE_VALUE. Volker's patch checks it.
Did I miss something?
Thanks.
--
H.J.