diff mbox

[C++] Couple of minor fixes

Message ID 5370A2F7.40502@oracle.com
State New
Headers show

Commit Message

Paolo Carlini May 12, 2014, 10:31 a.m. UTC
Hi,

almost obvious, I would say. Tested x86_64-linux.

Thanks,
Paolo.

////////////////
2014-05-12  Paolo Carlini  <paolo.carlini@oracle.com>

	* cvt.c (cp_convert_to_pointer): Don't call error_at if
	complain & tf_error is false.

	* decl.c (make_unbound_class_template): Prefer inform for
	"declared here"-type message.

Comments

Jason Merrill May 12, 2014, 2:04 p.m. UTC | #1
Yes, those seem obvious.

Jason
diff mbox

Patch

Index: cvt.c
===================================================================
--- cvt.c	(revision 210320)
+++ cvt.c	(working copy)
@@ -198,8 +198,9 @@  cp_convert_to_pointer (tree type, tree expr, tsubs
 						       complain);
 	    }
 	}
-      error_at (loc, "cannot convert %qE from type %qT to type %qT",
-		expr, intype, type);
+      if (complain & tf_error)
+	error_at (loc, "cannot convert %qE from type %qT to type %qT",
+		  expr, intype, type);
       return error_mark_node;
     }
 
Index: decl.c
===================================================================
--- decl.c	(revision 210320)
+++ decl.c	(working copy)
@@ -3491,7 +3491,8 @@  make_unbound_class_template (tree context, tree na
 	  if (complain & tf_error)
 	    {
 	      error ("template parameters do not match template");
-	      error ("%q+D declared here", tmpl);
+	      inform (DECL_SOURCE_LOCATION (tmpl),
+		      "%qD declared here", tmpl);
 	    }
 	  return error_mark_node;
 	}