diff options
author | Mark Mitchell <mark@codesourcery.com> | 2005-05-30 16:20:29 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2005-05-30 16:20:29 +0000 |
commit | d035c29621111dc216939c9a59ce612ff9c360d6 (patch) | |
tree | 34c66f3acb0861f9975d593fef0186158dbba67f /gcc | |
parent | 2a2ea376740f560a57da8b03a179928c7d29c3d4 (diff) | |
download | gcc-d035c29621111dc216939c9a59ce612ff9c360d6.zip gcc-d035c29621111dc216939c9a59ce612ff9c360d6.tar.gz gcc-d035c29621111dc216939c9a59ce612ff9c360d6.tar.bz2 |
re PR c++/21784 (Using vs builtin names)
PR c++/21784
* name-lookup.c (do_nonmember_using_decl): Ignore builtin
functions, even when the used name is not a function.
PR c++/21784
* g++.dg/lookup/using14.C: New test.
From-SVN: r100365
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 11 | ||||
-rw-r--r-- | gcc/cp/name-lookup.c | 17 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/lookup/using14.C | 8 |
4 files changed, 35 insertions, 9 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 66a3d4f..ae4aca7 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,9 +1,20 @@ +2005-05-30 Mark Mitchell <mark@codesourcery.com> + + PR c++/21784 + * name-lookup.c (do_nonmember_using_decl): Ignore builtin + functions, even when the used name is not a function. + 2005-05-30 Kazu Hirata <kazu@cs.umass.edu> * operators.def, optimize.c: Update copyright. 2005-05-28 Mark Mitchell <mark@codesourcery.com> + PR c++/21210 + * call.c (standard_conversion): Permit conversions to complex + types if conversion to the corresponding scalar type would be + permitted. + PR c++/21340 * method.c (implicitly_declare_fn): Clear processing_template_decl when generating implicit declaration. diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index bd83695..dde4227 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -2032,6 +2032,14 @@ do_nonmember_using_decl (tree scope, tree name, tree oldval, tree oldtype, return; } + /* It is impossible to overload a built-in function; any explicit + declaration eliminates the built-in declaration. So, if OLDVAL + is a built-in, then we can just pretend it isn't there. */ + if (oldval + && TREE_CODE (oldval) == FUNCTION_DECL + && DECL_ANTICIPATED (oldval)) + oldval = NULL_TREE; + /* Check for using functions. */ if (decls.value && is_overloaded_fn (decls.value)) { @@ -2044,15 +2052,6 @@ do_nonmember_using_decl (tree scope, tree name, tree oldval, tree oldtype, oldval = NULL_TREE; } - /* It is impossible to overload a built-in function; any - explicit declaration eliminates the built-in declaration. - So, if OLDVAL is a built-in, then we can just pretend it - isn't there. */ - if (oldval - && TREE_CODE (oldval) == FUNCTION_DECL - && DECL_ANTICIPATED (oldval)) - oldval = NULL_TREE; - *newval = oldval; for (tmp = decls.value; tmp; tmp = OVL_NEXT (tmp)) { diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 7fd9b0e..3e3c609 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2005-05-30 Mark Mitchell <mark@codesourcery.com> + + PR c++/21784 + * g++.dg/lookup/using14.C: New test. + 2005-05-30 Kazu Hirata <kazu@cs.umass.edu> * gcc.dg/c99-math-double-1.c, gcc.dg/c99-math-float-1.c, @@ -29,6 +34,9 @@ 2005-05-28 Mark Mitchell <mark@codesourcery.com> + PR c++/21210 + * g++.dg/ext/complex1.C: New test. + PR c++/21340 * g++.dg/init/ctor6.C: New test. diff --git a/gcc/testsuite/g++.dg/lookup/using14.C b/gcc/testsuite/g++.dg/lookup/using14.C new file mode 100644 index 0000000..072018e --- /dev/null +++ b/gcc/testsuite/g++.dg/lookup/using14.C @@ -0,0 +1,8 @@ +// PR c++/21784 + +namespace mine +{ + int cpow; +}; + +using mine::cpow; |