decl.c (duplicate_decls): Check for the return of permerror before emitting a note.
authorFabien Chêne <fabien@gcc.gnu.org>
Fri, 4 Apr 2014 08:03:19 +0000 (10:03 +0200)
committerFabien Chêne <fabien@gcc.gnu.org>
Fri, 4 Apr 2014 08:03:19 +0000 (10:03 +0200)
2014-04-04  Fabien Chêne  <fabien@gcc.gnu.org>

* decl.c (duplicate_decls): Check for the return of permerror
before emitting a note.

2014-04-04  Fabien Chêne  <fabien@gcc.gnu.org>

* g++.old-deja/g++.robertl/eb121.C: Adjust.
* g++.old-deja/g++.jason/overload21.C: Likewise.
* g++.old-deja/g++.law/init5.C: Likewise.

From-SVN: r209071

gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.old-deja/g++.jason/overload21.C
gcc/testsuite/g++.old-deja/g++.law/init5.C
gcc/testsuite/g++.old-deja/g++.robertl/eb121.C

index d174767edd779f54a510f9062d5869bf62f6ed8d..a57565416966df335ed7f55009b2528a96675bf5 100644 (file)
@@ -1,3 +1,8 @@
+2014-04-04  Fabien Chêne  <fabien@gcc.gnu.org>
+
+       * decl.c (duplicate_decls): Check for the return of permerror
+       before emitting a note.
+
 2014-04-03  Nathan Sidwell  <nathan@codesourcery.com>
 
        * class.c (accessible_nvdtor_p): New.
@@ -66,9 +71,9 @@
 2014-03-26  Fabien Chêne  <fabien@gcc.gnu.org>
 
        PR c++/52369
-       * cp/method.c (walk_field_subobs): Improve the diagnostic
+       * method.c (walk_field_subobs): Improve the diagnostic
        locations for both REFERENCE_TYPEs and non-static const members.
-       * cp/init.c (diagnose_uninitialized_cst_or_ref_member): Use %q#D
+       * init.c (diagnose_uninitialized_cst_or_ref_member): Use %q#D
        instead of %qD to be consistent with the c++11 diagnostic.
 
 2014-03-25  Jason Merrill  <jason@redhat.com>
index f3a081b8a8f50f241265ab144b3b520fdd91c8e9..f1743dd74dc3ce8efbdf3f2b5e0506e7e17c7c4c 100644 (file)
@@ -1737,9 +1737,9 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
                        if (permerror (input_location,
                                       "default argument given for parameter "
                                       "%d of %q#D", i, newdecl))
-                         permerror (DECL_SOURCE_LOCATION (olddecl),
-                                    "previous specification in %q#D here",
-                                    olddecl);
+                         inform (DECL_SOURCE_LOCATION (olddecl),
+                                 "previous specification in %q#D here",
+                                 olddecl);
                      }
                    else
                      {
index d470b1e6b35fd2a94e0063ba1bc721b92c728b43..0446485dfb88436715f2ca4c0677798c5e4d21dd 100644 (file)
@@ -1,3 +1,9 @@
+2014-04-04  Fabien Chêne  <fabien@gcc.gnu.org>
+
+       * g++.old-deja/g++.robertl/eb121.C: Adjust.
+       * g++.old-deja/g++.jason/overload21.C: Likewise.
+       * g++.old-deja/g++.law/init5.C: Likewise.
+
 2014-04-03  Cong Hou  <congh@google.com>
 
        PR tree-optimization/60505
@@ -22,7 +28,7 @@
 
        PR ipa/60659
        * testsuite/g++.dg/torture/pr60659.C: New testcase.
-       
+
 2014-04-02  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
 
        PR tree-optimization/60733
index 72397930367e341598325ed621364e7d042f9228..125aee0dbfc64c062ebada4f07cf4ecbe6715471 100644 (file)
@@ -1,6 +1,6 @@
 // { dg-do assemble  }
 struct X {
-  void f (int = 4, char = 'r');        // { dg-error "previous specification" } 
+  void f (int = 4, char = 'r');        // { dg-message "previous specification" } 
   void g (int = 4, char = 'r');        // { dg-message "previous specification" } 
 };
 
index c1d647b1b058ae72f4183fca2bfb6638c8bcc4fb..7ed89e21924a3c8ea5a872df825930c1a0daa78d 100644 (file)
@@ -11,8 +11,8 @@ extern int fred( int);
 
 class X {
       public :
-      void f( int = fred( 0) ) ; // { dg-error "" } previous spec
+      void f( int = fred( 0) ) ; // { dg-message "previous spec" }
 } ;
 
-void X::f( int x = fred( 0) ) {// { dg-error "" } .*
+void X::f( int x = fred( 0) ) { // { dg-error "default argument" }
 }
index e01d7478838f905fbd2aa8becb91d096ca12f3ae..036c8d5152afa22307cc3ac1f87bf6476197612f 100644 (file)
@@ -3,7 +3,7 @@ class A {
 private:
   int i1_;
 public:
-  void f(int const i1 = 1); // { dg-error "previous specification" }
+  void f(int const i1 = 1); // { dg-message "previous specification" }
 };
 
 void