llvm: Add workaround for STLport not being a full C++11 STL
llvm checks for C++11 support in the compiler, and assumes the
STL has full C++11 support if the compiler does.
However, for the combination of gcc 4.7 and STLport, that assumption
is incorrect -- the compiler supports rvalue references just fine, but
the STL hasn't caught up yet.
Longer term, the better fix would be to fix STLport.
Change-Id: I20237a19a3835faee583f429749751ee3c4843f6
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
diff --git a/include/llvm/Support/Compiler.h b/include/llvm/Support/Compiler.h
index 25f42a9..b2ae5bf 100644
--- a/include/llvm/Support/Compiler.h
+++ b/include/llvm/Support/Compiler.h
@@ -24,7 +24,10 @@
/// \brief Does the compiler support r-value references?
/// This implies that <utility> provides the one-argument std::move; it
/// does not imply the existence of any other C++ library features.
-#if (__has_feature(cxx_rvalue_references) \
+/// On Android, the compiler can handle r-value references -- but STLport is
+/// behind and doesn't implement std::move. So we have to ignore the
+/// compiler's support.
+#if !defined(ANDROID) && (__has_feature(cxx_rvalue_references) \
|| defined(__GXX_EXPERIMENTAL_CXX0X__) \
|| (defined(_MSC_VER) && _MSC_VER >= 1600))
#define LLVM_HAS_RVALUE_REFERENCES 1