[cfe-dev] New C++0x feature support in Clang
ofv at wanadoo.es
Fri Feb 4 14:07:30 PST 2011
Douglas Gregor <dgregor at apple.com> writes:
>>>>> How do I get the attached to compile without the
>>>>> following error about no std::move?
>>>>> /home/evansl/download/llvm/svn/build/Debug+Asserts/bin/clang++ -c
>>>>> -std=c++0x -U__GXX_EXPERIMENTAL_CXX0X__ -c -std=c++0x move.cpp
>>>>> move.cpp:6:16: error: no member named 'move' in namespace 'std'
>>>>> int j=std::move(i);
>>>> I suggest following the preprocessor logic to see what std::move isn't
>>>> getting defined. That -U__GXX_EXPERIMENTAL_CXX0X__ looks really, really
>>>> suspicious, though.
>>> The -U is there because, without it, the errors begin with:
>> -U__GXX_EXPERIMENTAL_CXX0X__ is for disabling C++0X features on
>> libstdc++. std::move is a C++0X feature.
> But the whole point of this thread is testing Clang's C++0x features
> with libstdc++ in C++0x mode! We don't learn anything by turning off
> these features in the library.
Precisely, the OP should remove -U__GXX_EXPERIMENTAL_CXX0X__ if he wants
to test Clang's support for libstdc++ >= 4.4. But my impression is that
he is just trying to get his code compiled with Clang and is trapped
between a rock and a hard place: -U__GXX_EXPERIMENTAL_CXX0X__ avoids
Clang's problems with libstdc++ C++0x features altogether but then his
code doesn't compile because it uses those features.
More information about the cfe-dev