diff options
author | Roger Sayle <roger@eyesopen.com> | 2003-09-06 16:14:30 +0000 |
---|---|---|
committer | Roger Sayle <sayle@gcc.gnu.org> | 2003-09-06 16:14:30 +0000 |
commit | 34ff26738c101dfa4a8dd25aecd3719f4481824a (patch) | |
tree | fbf5c5a92b6cd229539957d3a78ea8669ee81cb0 | |
parent | b9c87401ae95e5b970c32a854adbb154951551f3 (diff) | |
download | gcc-34ff26738c101dfa4a8dd25aecd3719f4481824a.zip gcc-34ff26738c101dfa4a8dd25aecd3719f4481824a.tar.gz gcc-34ff26738c101dfa4a8dd25aecd3719f4481824a.tar.bz2 |
re PR c++/11409 (using declarations and fabs built-in)
PR c++/11409
* class.c (resolve_address_of_overloaded_function): When building
list of matching non-template function decls, ignore anticipated
declarations of undeclared or shadowed GCC builtins.
* g++.dg/overload/builtin3.C: New test case.
From-SVN: r71139
-rw-r--r-- | gcc/cp/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/cp/class.c | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/overload/builtin3.C | 10 |
4 files changed, 27 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 49782e3..944bfd7 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +2003-09-06 Roger Sayle <roger@eyesopen.com> + + PR c++/11409 + * class.c (resolve_address_of_overloaded_function): When building + list of matching non-template function decls, ignore anticipated + declarations of undeclared or shadowed GCC builtins. + 2003-09-06 Steven Bosscher <steven@gcc.gnu.org> PR c++/11595 diff --git a/gcc/cp/class.c b/gcc/cp/class.c index 1bd63cf..80765c0 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -5777,7 +5777,11 @@ cannot resolve overloaded function `%D' based on conversion to type `%T'", /* We're looking for a non-static member, and this isn't one, or vice versa. */ continue; - + + /* Ignore anticipated decls of undeclared builtins. */ + if (DECL_ANTICIPATED (fn)) + continue; + /* See if there's a match. */ fntype = TREE_TYPE (fn); if (is_ptrmem) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 65f499d..e3c766c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2003-09-06 Roger Sayle <roger@eyesopen.com> + + PR c++/11409 + * g++.dg/overload/builtin3.C: New test case. + 2003-09-06 Steven Bosscher <steven@gcc.gnu.org> PR c/9862 diff --git a/gcc/testsuite/g++.dg/overload/builtin3.C b/gcc/testsuite/g++.dg/overload/builtin3.C new file mode 100644 index 0000000..dcd9fd0 --- /dev/null +++ b/gcc/testsuite/g++.dg/overload/builtin3.C @@ -0,0 +1,10 @@ +// PR c++/11409 +// { dg-do compile } + +namespace std { + double fabs (double); +} +using std::fabs; + +double (*p) (double) = &fabs; // { dg-bogus "is ambiguous" "" } + |