> Yes, but the problem is that remap_decl isn't getting called. Right, I can get it to be called by adding a pushdecl to grokdeclarator...
> Attaching it to the BIND_EXPR doesn't help walk_tree_1 do the right > thing with the DECL_EXPR. ... but, indeed, this still ICEs. So the key is that the DECL_EXPR_DECL of the copied DECL_EXPR points to the remapped TYPE_DECL before the type is copied? If so, then your original patch is probably the way to go, but the comment would need to be slightly adjusted. In Ada, where we attach the TYPE_DECL to the BIND_EXPR, this will mean that remap_decl is invoked 3 times per TYPE_DECL: first twice from copy_bind_expr and then once again for the DECL_EXPR. But probably no big deal in the end. -- Eric Botcazou