On 05/01/2012 11:01 PM, Paolo Carlini wrote:
Well, not really. The first time walk_template_parms_r is called, t is a SIZEOF_EXPR which remains unhandled, the function returns NULL_TREE. The second time, t is a COMPONENT_REF, thus !TYPE_P (t) is true, TREE_TYPE is NULL, the function immediately returns error_mark_node and the iteration ends (with the correct result that the expression is instantiation-dependent).
Ah, I guess we can't get to a FIELD_DECL without going through an expression with null type. OK, can leave out the FIELD_DECL case then with a comment.
I also booted and tested a variant, attached, which changes finish_static_assert to also use instantiation_dependent_expression_p and also passes testing: nice, between front-end and library we stress the new function quite a bit more.
Great. Let's also use it for sizeof/alignof, controlled with abi_version_at_least (7), since it affects mangling. And then figure out what we're going to to about ABI transition in 4.8...
Jason