This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/11472] New: [3.4 regression] abs not found if <iostream> is included
- From: "benko at sztaki dot hu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 Jul 2003 12:16:37 -0000
- Subject: [Bug libstdc++/11472] New: [3.4 regression] abs not found if <iostream> is included
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11472
Summary: [3.4 regression] abs not found if <iostream> is included
Product: gcc
Version: 3.4
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: libstdc++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: benko at sztaki dot hu
CC: gcc-bugs at gcc dot gnu dot org
arta:~/c/proba$ cat abs.cc
#include <cmath>
#ifndef WORKAROUND
# include <iostream>
#endif /* WORKAROUND */
using std::abs;
double
f()
{
return abs(-0.25);
}
arta:~/c/proba$ g++-cvs -v
Reading specs from /gml/shared/gcc-cvs/lib/gcc-lib/i686-pc-linux-gnu/3.4/specs
Configured with: ../gcc/configure --prefix=/gml/shared/gcc-cvs
--enable-languages=c++
Thread model: posix
gcc version 3.4 20030709 (experimental)
arta:~/c/proba$ g++-cvs -c abs.cc
abs.cc: In function `double f()':
abs.cc:13: error: call of overloaded `abs(double)' is ambiguous
/usr/include/stdlib.h:699: note: candidates are: int abs(int)
/gml/shared/gcc-cvs/include/c++/3.4/cstdlib:149: note: long
long int __gnu_cxx::abs(long long int)
zsh: exit 1 g++-cvs -c abs.cc
arta:~/c/proba$ g++-cvs -c -D WORKAROUND abs.cc
arta:~/c/proba$
(Of course not including <iostream> is a not too comfortable workaround.)