diff options
author | Craig Rodrigues <rodrigc@gcc.gnu.org> | 2002-02-18 03:00:38 +0000 |
---|---|---|
committer | Craig Rodrigues <rodrigc@gcc.gnu.org> | 2002-02-18 03:00:38 +0000 |
commit | 624a5800d114ed9907e0e9566ab0e89ad7547d88 (patch) | |
tree | 58d02eaeb48403a3834b62ca3061d6dcda30bbbb /gcc | |
parent | 21fe5f6a237a7a00926872614dd35dd2924348f9 (diff) | |
download | gcc-624a5800d114ed9907e0e9566ab0e89ad7547d88.zip gcc-624a5800d114ed9907e0e9566ab0e89ad7547d88.tar.gz gcc-624a5800d114ed9907e0e9566ab0e89ad7547d88.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/decl.c | 11 |
2 files changed, 10 insertions, 7 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 872ad4f..9fd36c9 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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 diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 697120a..bd5bdc2 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -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 { |