re PR c++/11409 (using declarations and fabs built-in)
authorRoger Sayle <roger@eyesopen.com>
Sat, 6 Sep 2003 16:14:30 +0000 (16:14 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Sat, 6 Sep 2003 16:14:30 +0000 (16:14 +0000)
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

gcc/cp/ChangeLog
gcc/cp/class.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/overload/builtin3.C [new file with mode: 0644]

index 49782e3f3b1bf2536f966bd5143632899f64be80..944bfd789eecfe292e8d301db6d557e0f9d69525 100644 (file)
@@ -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
index 1bd63cffa6b870c657d63697fa33695026ea4715..80765c0d9607f7b79fa3bc66032e503067271c65 100644 (file)
@@ -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)
index 65f499d18346b6e829b3ff65767db6ea3b7538bd..e3c766c482ed63a307eb77d69e384395bf68b90f 100644 (file)
@@ -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 (file)
index 0000000..dcd9fd0
--- /dev/null
@@ -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" "" }
+