It appears that clang (3.4) automatically accepts some c++11 (e.g. auto, for(:)) without a special flag (though producing a warning), but not other parts (e.g. lambdas).
For example the following compiles clang++ c++11.success.cpp
:
#include <vector>
int main( int argCount, char ** argVec )
{
std::vector<int> vec;
for( auto & item : vec )
{
++item;
}
return 0;
}
but this fails clang++ c++11.failure.cpp
:
#include <vector>
int main( int argCount, char ** argVec )
{
std::vector<int> vec;
auto lambda = [] ( int & foo ) { return ++foo; }; //This line fails at []
for( auto & item : vec )
{
lambda( item );
}
return 0;
}
With clang++ c++11.failure.cpp -std=c++11
of course it succeeds.
I couldn't find any specific documentation as to which c++11
features are supported without -std=c++11
and why. Anyone have a clue?