zero and pointer conversions in g++
Thomas Braxton
brax108@cox.net
Tue Dec 27 05:47:00 GMT 2005
I have this test code that I think g++ is selecting the wrong function when
the second argument is a zero. If compiled with HAVE_ASCII_DEFAULT 1 it
selects read(const char*, const char*) instead of read(const char*, const
Variant&), for test2a/test3a. If compiled with HAVE_ASCII_DEFAULT 0
compilation fails because test2a/test3a are ambiguous. Shouldn't all of the
tests select the Variant function, or am I missing something? Why do I have
to explicitly create a Variant when the argument is zero?
Tested w/ g++ 3.4.3 (Mandrakelinux 10.2 3.4.3-7mdk) and 4.0.1 (self compiled)
TIA,
Thomas
PS please CC as I'm not subscribed
-------------- next part --------------
A non-text attachment was scrubbed...
Name: readentry.cpp
Type: text/x-c++src
Size: 2286 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20051227/4baa78d3/attachment.bin>
More information about the Gcc
mailing list