Commit 624a5800 by Craig Rodrigues

re PR c++/5685 (g++ 3.0.2 allows multiple identical declaration of default argument)

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
parent 21fe5f6a
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> 2002-02-17 Jakub Jelinek <jakub@redhat.com>
* typeck.c (build_binary_op) [BIT_XOR_EXPR]: Remove explicit * typeck.c (build_binary_op) [BIT_XOR_EXPR]: Remove explicit
......
...@@ -3389,14 +3389,11 @@ duplicate_decls (newdecl, olddecl) ...@@ -3389,14 +3389,11 @@ duplicate_decls (newdecl, olddecl)
if (1 == simple_cst_equal (TREE_PURPOSE (t1), if (1 == simple_cst_equal (TREE_PURPOSE (t1),
TREE_PURPOSE (t2))) TREE_PURPOSE (t2)))
{ {
if (pedantic)
{
pedwarn ("default argument given for parameter %d of `%#D'", pedwarn ("default argument given for parameter %d of `%#D'",
i, newdecl); i, newdecl);
cp_pedwarn_at ("after previous specification in `%#D'", cp_pedwarn_at ("after previous specification in `%#D'",
olddecl); olddecl);
} }
}
else else
{ {
error ("default argument given for parameter %d of `%#D'", error ("default argument given for parameter %d of `%#D'",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment