This is the mail archive of the gcc@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]

Possible bug in g++: 0U == 0 == NULL?


The following small test case fails to compile with
gcc-2.95:

-----------------------------------
void foo (void *p)
{
}

void foo (unsigned short s)
{
}

int
main ()
{
    foo (0U);
}
-----------------------------------

The compiler complains that
test.cc: In function `int main()':
test.cc:12: call of overloaded `foo (unsigned int)' is ambiguous
test.cc:2: candidates are: void foo(void *)
test.cc:6:                 void foo(short unsigned int)

Note that the argument is 0U and those marked not
to be a pointer...

g++ is
Reading specs from /usr/lib/gcc-lib/i386-linux/2.95/specs
gcc version 2.95 19990728 (release)

-- 
Regards
       Joerg
GMD-IPSI, Dolivostr. 15, Zimmer 120, D-64293 Darmstadt
+49-6151-869-786 (Phone), -818 (FAX)


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