]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
name-lookup.c (push_overloaded_decl): Don't error if the new decl matches the old...
authorAlexandre Oliva <aoliva@redhat.com>
Wed, 2 Mar 2005 19:57:10 +0000 (19:57 +0000)
committerAlexandre Oliva <aoliva@gcc.gnu.org>
Wed, 2 Mar 2005 19:57:10 +0000 (19:57 +0000)
gcc/cp/ChangeLog:
* name-lookup.c (push_overloaded_decl): Don't error if the new
decl matches the old one.
* decl.c (redeclaration_error_message): Likewise.
gcc/testsuite/ChangeLog:
* g++.dg/overload/using2.C: New.

From-SVN: r95800

gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/cp/name-lookup.c
gcc/testsuite/ChangeLog

index 003cff3cf844af840e6ff854da1b9c061899584f..9eeebd992265c6b798980616e00f11c8d86166fa 100644 (file)
@@ -1,3 +1,9 @@
+2005-03-02  Alexandre Oliva  <aoliva@redhat.com>
+
+       * name-lookup.c (push_overloaded_decl): Don't error if the new
+       decl matches the old one.
+       * decl.c (redeclaration_error_message): Likewise.
+
 2005-02-24  Jakub Jelinek  <jakub@redhat.com>
 
        PR c++/20175
index 397b60d56441060d3c368f9825e69d2d52d0a32e..84c25d467e0941c98549ab49e7aa16d53b6a7f16 100644 (file)
@@ -1,6 +1,6 @@
 /* Process declarations and variables for C++ compiler.
    Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-   2001, 2002, 2003, 2004  Free Software Foundation, Inc.
+   2001, 2002, 2003, 2004, 2005  Free Software Foundation, Inc.
    Contributed by Michael Tiemann (tiemann@cygnus.com)
 
 This file is part of GCC.
@@ -2023,7 +2023,8 @@ redeclaration_error_message (tree newdecl, tree olddecl)
       /* If both functions come from different namespaces, this is not
         a redeclaration - this is a conflict with a used function.  */
       if (DECL_NAMESPACE_SCOPE_P (olddecl)
-         && DECL_CONTEXT (olddecl) != DECL_CONTEXT (newdecl))
+         && DECL_CONTEXT (olddecl) != DECL_CONTEXT (newdecl)
+         && ! decls_match (olddecl, newdecl))
        return "`%D' conflicts with used function";
 
       /* We'll complain about linkage mismatches in
index 80f4c2946c25e6c64d1d175e901d4f7b7906937a..3e79d3e568eb7e5badf90117d8a6fcfa2acca872 100644 (file)
@@ -1,5 +1,5 @@
 /* Definitions for C++ name lookup routines.
-   Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
    Contributed by Gabriel Dos Reis <gdr@integrable-solutions.net>
 
 This file is part of GCC.
@@ -2018,7 +2018,8 @@ push_overloaded_decl (tree decl, int flags)
              if (TREE_CODE (tmp) == OVERLOAD && OVL_USED (tmp)
                  && !(flags & PUSH_USING)
                  && compparms (TYPE_ARG_TYPES (TREE_TYPE (fn)),
-                               TYPE_ARG_TYPES (TREE_TYPE (decl))))
+                               TYPE_ARG_TYPES (TREE_TYPE (decl)))
+                 && ! decls_match (fn, decl))
                error ("`%#D' conflicts with previous using declaration `%#D'",
                          decl, fn);
 
index 86bf512dcda687ddc8bd589749178df5a5888f9d..dca1f18ba35017608ff256acd31795c7b01e9751 100644 (file)
@@ -1,3 +1,7 @@
+2005-03-02  Alexandre Oliva  <aoliva@redhat.com>
+
+       * g++.dg/overload/using2.C: New.
+
 2005-02-24  Jakub Jelinek  <jakub@redhat.com>
 
        PR c++/20175