The following is a reduced form of 26_numerics/cmath/fabs_inline.cc which has failed for a very long time on Alpha, but doesn't fail on other platforms and so isn't getting fixed. The problem is that Alpha's headers have an inline version of floor which uses fabs. This usage isn't present on other systems. Which leads to the following reduced test case -------------------------------------------------------- extern "C" { extern double fabs (double __x) throw () __attribute__ ((__const__)); __inline double fabs (double __x) throw () { return __builtin_fabs (__x); } } double fail_me(double __x) { return fabs(__x); } namespace std { using ::fabs; } typedef double (*realfn) (double); using std::fabs; int main () { realfn myfn = fabs; } -------------------------------------------------------- which will pass if fail_me is commented out.
Confirmed, it is also builtins related too. Changing it to be a instead of fabs works.
Err... Just tried this on mainline x86_64-linux-gnu and it didn't fail. Maybe it's fixed in mainline? It seems to be still broken in 3.4.3.
Patch here: <http://gcc.gnu.org/ml/gcc-patches/2005-02/msg00370.html>.
Closing as fixed per <http://gcc.gnu.org/ml/gcc-patches/2005-02/msg00382.html>.
Subject: Bug 18838 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_4-rhl-branch Changes by: jakub@gcc.gnu.org 2005-02-28 08:26:41 Modified files: gcc/cp : ChangeLog gcc/testsuite : ChangeLog gcc/cp : name-lookup.c Added files: gcc/testsuite/g++.dg/lookup: builtin1.C builtin2.C Log message: PR c++/18838 2005-01-30 Mark Mitchell <mark@codesourcery.com> PR c++/19367 * name-lookup.c (do_nonmember_using_decl): Avoid overloading builtin declarations. PR c++/18838 * g++.dg/lookup/builtin2.C: New test. 2005-01-30 Mark Mitchell <mark@codesourcery.com> PR c++/19367 * g++.dg/lookup/builtin1.C: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-rhl-branch&r1=1.3892.2.99.2.24&r2=1.3892.2.99.2.25 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-rhl-branch&r1=1.3389.2.170.2.45&r2=1.3389.2.170.2.46 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/name-lookup.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-rhl-branch&r1=1.34.2.11.2.8&r2=1.34.2.11.2.9 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/lookup/builtin1.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-rhl-branch&r1=NONE&r2=1.1.18.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/lookup/builtin2.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-rhl-branch&r1=NONE&r2=1.1.2.1