diff options
author | Alexandre Oliva <aoliva@redhat.com> | 2005-03-02 19:55:52 +0000 |
---|---|---|
committer | Alexandre Oliva <aoliva@gcc.gnu.org> | 2005-03-02 19:55:52 +0000 |
commit | 713101a65e1ebfc829f030bd68f32a8f91703ac0 (patch) | |
tree | 83c5262d7842a3f042e65278bf3c6eacf9f98405 /gcc/cp | |
parent | ac0bd8018d589a221f8ad95f7a2ddd4d228f1bb5 (diff) | |
download | gcc-713101a65e1ebfc829f030bd68f32a8f91703ac0.zip gcc-713101a65e1ebfc829f030bd68f32a8f91703ac0.tar.gz gcc-713101a65e1ebfc829f030bd68f32a8f91703ac0.tar.bz2 |
name-lookup.c (push_overloaded_decl): Don't error if the new decl matches the old one.
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: r95798
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/decl.c | 3 | ||||
-rw-r--r-- | gcc/cp/name-lookup.c | 3 |
3 files changed, 10 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 55ec854..0fc67aa 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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-03-01 Per Bothner <per@bothner.com> * decl.c (finish_function): Use SET_EXPR_LOCATION instead of diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index bfe503f..dfc1790 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -1920,7 +1920,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 "%qD conflicts with used function"; /* We'll complain about linkage mismatches in diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index 7d944d0..accd352 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -1875,7 +1875,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 ("%q#D conflicts with previous using declaration %q#D", decl, fn); |