This is the mail archive of the gcc-patches@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] |
The problem is when you compare it to
template<class T> void foo(T*); // #1 void foo(nullptr_t); // #2
where nullptr_t is a better match for foo(0).
I think the overload resolution should be
1. int 2. nullptr_t 3. any pointer type
but that it probably better discussed over at comp.std.c++.
I found out that the problem was that each pattern only match once so I had to add one more dg-message as follows
char* k(char*);/* { dg-message "note" } { dg-message "note" } */
+ if (TREE_CODE (intype) == NULLPTR_TYPE) + return build_int_cst (type, 0);
Why not fall through to cp_convert in this case?
cp_convert in effect performs static_cast<target>(source), in this case that would be static_cast<integer-type>(nullptr) but that conversion isn't valid except when integer-type is bool.
Removing this part triggers the following unexpected errors in the test suite:
/usr/local/src/gcc/trunk/gcc/testsuite/g++.dg/cpp0x/nullptr04.C:8:55: error: aggregate value used where an integer was expected /usr/local/src/gcc/trunk/gcc/testsuite/g++.dg/cpp0x/nullptr04.C:9:31: error: aggregate value used where an integer was expected
Does GCC mangle the same on all platforms and ignore the mangling of the default platform compiler?
Now the missing parts are a lot smaller - there is no support for output of nullptr's (as opposed to nullptr_t's) but i do not see how to generate a nullptr either
and there are still a bunch of missing debug output formats.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |