... well, I suppose that in principle the super-safe thing to do in such cases would be checking immediately and returning immediately only if we are in a SFINAE context. Like in the untested patchlet attached.

Paolo.

/////////////////////
Index: pt.c
===================================================================
--- pt.c        (revision 237196)
+++ pt.c        (working copy)
@@ -13430,6 +13430,10 @@ tsubst (tree t, tree args, tsubst_flags_t complain
       {
        tree ctx = tsubst_aggr_type (TYPE_CONTEXT (t), args, complain,
                                     in_decl, /*entering_scope=*/1);
+       if (!(complain & tf_error)
+           && ctx == error_mark_node)
+         return error_mark_node;
+
        tree f = tsubst_copy (TYPENAME_TYPE_FULLNAME (t), args,
                              complain, in_decl);
 

Reply via email to