aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorBenjamin Kosnik <bkoz@gcc.gnu.org>1998-04-13 11:13:36 +0000
committerBenjamin Kosnik <bkoz@gcc.gnu.org>1998-04-13 11:13:36 +0000
commit556ffb6757a5bdcb8ad49656214c2e74a63d619b (patch)
treef0bdecf0b179cab730191742125994a51007e3af /gcc
parentd74ce43a8b1e061355c24199ed4de33842755e5d (diff)
downloadgcc-556ffb6757a5bdcb8ad49656214c2e74a63d619b.zip
gcc-556ffb6757a5bdcb8ad49656214c2e74a63d619b.tar.gz
gcc-556ffb6757a5bdcb8ad49656214c2e74a63d619b.tar.bz2
decl.c (duplicate_decls): Don't warn for redundant decls if friend: let add_friend take care of it.
x Fri Apr 10 12:16:49 1998 Benjamin Kosnik <bkoz@loony.cygnus.com> * decl.c (duplicate_decls): Don't warn for redundant decls if friend: let add_friend take care of it. Fixes g++/15307 From-SVN: r19198
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/decl.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index a71a768..cb2b005 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -2786,7 +2786,9 @@ duplicate_decls (newdecl, olddecl)
&& ! DECL_ARTIFICIAL (olddecl)
&& !(new_defines_function && DECL_INITIAL (olddecl) == NULL_TREE)
/* Don't warn about extern decl followed by (tentative) definition. */
- && !(DECL_EXTERNAL (olddecl) && ! DECL_EXTERNAL (newdecl)))
+ && !(DECL_EXTERNAL (olddecl) && ! DECL_EXTERNAL (newdecl))
+ /* Don't warn about friends, let add_friend take care of it. */
+ && ! DECL_FRIEND_P (newdecl))
{
cp_warning ("redundant redeclaration of `%D' in same scope", newdecl);
cp_warning_at ("previous declaration of `%D'", olddecl);