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

[Bug c++/34480] New: Argument packs treat __null oddly


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


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