[C++ Patch/RFC] Tiny tsubst tweak

Paolo Carlini paolo.carlini@oracle.com
Wed Jun 8 12:48:00 GMT 2016


... 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.

/////////////////////
-------------- next part --------------
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);
 


More information about the Gcc-patches mailing list