This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFH / Patch] PR 51222

On 05/02/2012 12:39 AM, Jason Merrill wrote:
On 05/01/2012 04:06 PM, Paolo Carlini wrote:
Hmm, this preexisting code seems to assume that any type-dependent
expression must include a direct use of a template parameter, but it
might just have a declaration with dependent type. We should also test
any_p/check_types, and this should apply to all expressions, not just

I'm not 100% sure to understand the last two comments.

I mean

if (check_types && !fn && !TYPE_P (t) && TREE_TYPE (t) == NULL_TREE)
  return error_mark_node.

instead of any cases for expressions.
Let's see if I got it right this time (I'm sorry, when a few days ago I noticed that we weren't tsubsting at all I thought the fix would be quite straightforward for me to handle because very local I didn't expect we would go ahead and resolve the FIXME about instantiation-dependent): we want to check for the above at the beginning of the function, like in the below. Indeed it works and allows me remove the check for TREE_TYPE in instantiation_dependent_expression_p, good.

Note, there is the minor subtlety with checking !fn explicitly: in my current patch it's redundant because I make sure in the caller that when check_types is true, any fn accidentally passed by upper caller as non-null is zeroed. This way, walk_template_parms_r can indeed do away with explicit checks for !fn when check_types is true or trust the users of walk_template_parms to make sure that fn is NULL together with check_types true (I don't think fn non-null together with check_types true makes any sense). I hope my explanation is clear enough ;) If you want me to handle this detail differently, just let know.



Attachment: patch_51222_6
Description: Text document

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]