diff mbox

[C++,Patch/RFC] Tiny tsubst tweak

Message ID 5758141E.9050205@oracle.com
State New
Headers show

Commit Message

Paolo Carlini June 8, 2016, 12:48 p.m. UTC
... 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.

/////////////////////

Comments

Jason Merrill June 8, 2016, 5:50 p.m. UTC | #1
The first patch is OK.

Jason
diff mbox

Patch

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);