[Bug c++/34480] New: Argument packs treat __null oddly
gcc at magfr dot user dot lysator dot liu dot se
gcc-bugzilla@gcc.gnu.org
Sat Dec 15 14:18:00 GMT 2007
The following program fails to compile in c++0x mode:
template <class ... A> void* f(A... a) { return new (char*)(a...); }
int main() {
f(__null);
}
Now, this doesn't sound that bad until one notice that this is functionally
equivalent with
#include <vector>
int main() {
std::vector<char*> v;
v.push_back(NULL);
}
and that used to and still do work perfectly well under c++98.
Note that if __null is replaced with 0 then it works so this suggests that the
__null case have been forgotten somewhere.
--
Summary: Argument packs treat __null oddly
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: gcc at magfr dot user dot lysator dot liu dot se
GCC build triplet: i586-pc-linux-gnu
GCC host triplet: i586-pc-linux-gnu
GCC target triplet: i586-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34480
More information about the Gcc-bugs
mailing list