This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/58316] New: error: call of overloaded âfoo(long long unsigned int, long long unsigned int)â is ambiguous


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

            Bug ID: 58316
           Summary: error: call of overloaded âfoo(long long unsigned int,
                    long long unsigned int)â is ambiguous
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pluto at agmk dot net

$ cat t.cpp 
#if !defined( __GNUC__) && !defined( __x86_64__)
#error "testcase requires LLP64 arch"
#endif

typedef unsigned long u64_t1;

void foo( u64_t1, u64_t1 );
void foo( unsigned, unsigned );

void bar()
{
        foo( 0xffffffffffffffffull, 0xffffffffffffffffull );
}


$ g++ -Wall t.cpp -c -m64
t.cpp: In function âvoid bar()â:
t.cpp:12:52: error: call of overloaded âfoo(long long unsigned int, long long
unsigned int)â is ambiguous
  foo( 0xffffffffffffffffull, 0xffffffffffffffffull );
                                                    ^
t.cpp:12:52: note: candidates are:
t.cpp:7:6: note: void foo(u64_t1, u64_t1)
 void foo( u64_t1, u64_t1 );
      ^
t.cpp:8:6: note: void foo(unsigned int, unsigned int)
 void foo( unsigned, unsigned );
      ^


the 'unsigned long' and 'unsigned long long' have the same size
on the x86-64(llp64) target, so where's the ambiguity?

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]