re PR c++/5685 (g++ 3.0.2 allows multiple identical declaration of default argument)
authorCraig Rodrigues <rodrigc@gcc.gnu.org>
Mon, 18 Feb 2002 03:00:38 +0000 (03:00 +0000)
committerCraig Rodrigues <rodrigc@gcc.gnu.org>
Mon, 18 Feb 2002 03:00:38 +0000 (03:00 +0000)
2002-02-17  Craig Rodrigues  <rodrigc@gcc.gnu.org>

        PR c++/5685
        * decl.c (duplicate_decls): Make warning unconditional
        if duplicate default argument declarations are present.

From-SVN: r49830

gcc/cp/ChangeLog
gcc/cp/decl.c

index 872ad4f4113e1ba38f2e08aa2488b7baa3fa22fa..9fd36c950a61cf4d447ecfe125b98dabe38fc906 100644 (file)
@@ -1,3 +1,9 @@
+2002-02-17  Craig Rodrigues  <rodrigc@gcc.gnu.org>
+
+       PR c++/5685
+       * decl.c (duplicate_decls): Make warning unconditional
+       if duplicate default argument declarations are present.
+
 2002-02-17  Jakub Jelinek  <jakub@redhat.com>
 
        * typeck.c (build_binary_op) [BIT_XOR_EXPR]: Remove explicit
index 697120a30916751e8ddb96de8e50262293c61ac8..bd5bdc26b047414a151c0f398b88f8add7d67f2a 100644 (file)
@@ -3389,13 +3389,10 @@ duplicate_decls (newdecl, olddecl)
                if (1 == simple_cst_equal (TREE_PURPOSE (t1),
                                           TREE_PURPOSE (t2)))
                  {
-                   if (pedantic)
-                     {
-                       pedwarn ("default argument given for parameter %d of `%#D'",
-                                   i, newdecl);
-                       cp_pedwarn_at ("after previous specification in `%#D'",
-                                      olddecl);
-                     }
+                   pedwarn ("default argument given for parameter %d of `%#D'",
+                            i, newdecl);
+                   cp_pedwarn_at ("after previous specification in `%#D'",
+                                  olddecl);
                  }
                else
                  {