diff mbox

[C++] One more error + error to error + inform

Message ID 5763DFF6.4030501@oracle.com
State New
Headers show

Commit Message

Paolo Carlini June 17, 2016, 11:33 a.m. UTC
Hi,

one more I missed. Tested x86_64-linux. Should be obvious too...

Thanks,
Paolo.

PS: I still have pending: 
https://gcc.gnu.org/ml/gcc-patches/2016-06/msg01116.html

//////////////////////
/cp
2016-06-17  Paolo Carlini  <paolo.carlini@oracle.com>

	* decl.c (grokfndecl): Change pair of errors to error + inform.

/testsuite
2016-06-17  Paolo Carlini  <paolo.carlini@oracle.com>

	* g++.dg/cpp0x/defaulted31.C: Adjust for dg-message vs dg-error.

Comments

Jason Merrill June 17, 2016, 5:24 p.m. UTC | #1
OK.

Jason
diff mbox

Patch

Index: cp/decl.c
===================================================================
--- cp/decl.c	(revision 237547)
+++ cp/decl.c	(working copy)
@@ -8295,7 +8295,8 @@  grokfndecl (tree ctype,
 	  else if (DECL_DEFAULTED_FN (old_decl))
 	    {
 	      error ("definition of explicitly-defaulted %q+D", decl);
-	      error ("%q+#D explicitly defaulted here", old_decl);
+	      inform (DECL_SOURCE_LOCATION (old_decl),
+		      "%q#D explicitly defaulted here", old_decl);
 	      return NULL_TREE;
 	    }
 
Index: testsuite/g++.dg/cpp0x/defaulted31.C
===================================================================
--- testsuite/g++.dg/cpp0x/defaulted31.C	(revision 237547)
+++ testsuite/g++.dg/cpp0x/defaulted31.C	(working copy)
@@ -4,7 +4,7 @@ 
 struct A
 {
   A() { }			// { dg-message "defined" }
-  ~A() = default;		// { dg-error "defaulted" }
+  ~A() = default;		// { dg-message "defaulted" }
 };
 
 A::A() = default;		// { dg-error "redefinition" }