[RFA] Implement DW_TAG_*_parameter_pack
Jason Merrill
jason@redhat.com
Fri Sep 18 21:16:00 GMT 2009
On 09/18/2009 03:34 PM, Dodji Seketeli wrote:
> Le 18/09/2009 19:57, Jason Merrill a écrit :
>> I don't see why it wouldn't. DECL_PARM_INDEX is set at parse time, so
>> all parms expanded from a single function parameter pack will have the
>> same value.
>
> It makes sense. The attached patch does that.
No, it doesn't; I still see
> + /* OK, this is a hack. We know that if PARAM_DECL is expanded from PACK,
> + its name (built with make_ith_pack_parameter_name) is the string "<foo>#N"
> + where <foo> is the name of PACK and N is a number.
> + So we just check that naming pattern. */
> + if (! strncmp (IDENTIFIER_POINTER (DECL_NAME (param_decl)),
> + IDENTIFIER_POINTER (DECL_NAME (pack)),
> + IDENTIFIER_LENGTH (DECL_NAME (pack)))
> + && (IDENTIFIER_LENGTH (DECL_NAME (pack))
> + < IDENTIFIER_LENGTH (DECL_NAME (param_decl)))
> + && (IDENTIFIER_POINTER
> + (DECL_NAME (param_decl))[IDENTIFIER_LENGTH (DECL_NAME (pack))]
> + == '#'))
> + return true;
Jason
More information about the Gcc-patches
mailing list