Date
2007-12-28.00:00:00
Message id
3703

Content

Playing with g++'s C++0X mode, I noticed that the following code, which used to compile:

#include <vector>

int main()
{
    std::vector<char *> v;
    v.push_back(0);
}

now fails with the following error message:

.../include/c++/4.3.0/ext/new_allocator.h: In member function 'void __gnu_cxx::new_allocator<_Tp>::construct(_Tp*, _Args&& ...) [with _Args = int, _Tp = char*]': .../include/c++/4.3.0/bits/stl_vector.h:707: instantiated from 'void std::vector<_Tp, _Alloc>::push_back(_Args&& ...) [with _Args = int, _Tp = char*, _Alloc = std::allocator<char*>]' test.cpp:6: instantiated from here .../include/c++/4.3.0/ext/new_allocator.h:114: error: invalid conversion from 'int' to 'char*'

As far as I know, g++ follows the current draft here.

Does the committee really intend to break compatibility for such cases?