public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/13943] New: call of overloaded `llabs(int)' is ambiguous
@ 2004-01-31 11:52 debian-gcc at lists dot debian dot org
  2004-01-31 18:56 ` [Bug libstdc++/13943] " pinskia at gcc dot gnu dot org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: debian-gcc at lists dot debian dot org @ 2004-01-31 11:52 UTC (permalink / raw)
  To: gcc-bugs

[forwarded from http://bugs.debian.org/228645]

on i486-linux, glibc-2.3.2 based.

---
#include <math.h>
#include <cstdlib>

using namespace std;

int foo() { return llabs(1); }
---

g++-3.3 blah.cc -c
blah.cc: In function `int foo()':
blah.cc:6: error: call of overloaded `llabs(int)' is ambiguous
/usr/include/stdlib.h:754: error: candidates are: long long int llabs(long long
   int)
/usr/include/c++/3.3/cstdlib:152: error:                 long long int
   __gnu_cxx::llabs(long long int)

This works in g++ 3.2, but not 3.3 and 3.4.
<vector> pulls in <cstdlib>, so using <math.h> and <vector> together causes
this problem.  That is, it's triggered even if you don't use the <cstdlib>
header: merely mixing vector with math.h triggers it, and it's impossible
to avoid math.h (as library headers often pull it in.)

This doesn't happen with other functions in cstdlib, such as abs().
Comments in /usr/include/c++/3.3/cstdlib indicate that it's intended to
work ("// Get rid of those macros defined in <stdlib.h> ...").

-- 
           Summary: call of overloaded `llabs(int)' is ambiguous
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: debian-gcc at lists dot debian dot org
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13943


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2005-09-07 10:56 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-31 11:52 [Bug libstdc++/13943] New: call of overloaded `llabs(int)' is ambiguous debian-gcc at lists dot debian dot org
2004-01-31 18:56 ` [Bug libstdc++/13943] " pinskia at gcc dot gnu dot org
2004-02-02 23:16 ` bangerth at dealii dot org
2005-05-21 23:26 ` g_bugz at zewt dot org
2005-05-21 23:35 ` pinskia at gcc dot gnu dot org
2005-05-21 23:35 ` pinskia at gcc dot gnu dot org
2005-05-22  9:15 ` pcarlini at suse dot de
2005-05-22  9:32 ` pcarlini at suse dot de
2005-05-22 10:32 ` gdr at integrable-solutions dot net
2005-05-22 21:20 ` pcarlini at suse dot de
2005-05-26 15:57 ` cvs-commit at gcc dot gnu dot org
2005-09-07 10:56 ` pcarlini at suse dot de

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).