This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/34480] New: Argument packs treat __null oddly
- From: "gcc at magfr dot user dot lysator dot liu dot se" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Dec 2007 14:18:33 -0000
- Subject: [Bug c++/34480] New: Argument packs treat __null oddly
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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