[llvm] r196448 - Compiler.h: Disable initializer list usage with clang-cl
Reid Kleckner
reid at kleckner.net
Wed Dec 4 17:03:23 PST 2013
Author: rnk
Date: Wed Dec 4 19:03:23 2013
New Revision: 196448
URL: http://llvm.org/viewvc/llvm-project?rev=196448&view=rev
Log:
Compiler.h: Disable initializer list usage with clang-cl
Most people are using MSVC 2012, which lacks the <initializer_list>
header. MSVC 2013 shipped with that header, but it has not yet been
tested. If clang works with the 2013 header, then we can enable this by
checking the value of _MSC_VER.
Modified:
llvm/trunk/include/llvm/Support/Compiler.h
Modified: llvm/trunk/include/llvm/Support/Compiler.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Compiler.h?rev=196448&r1=196447&r2=196448&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/Compiler.h (original)
+++ llvm/trunk/include/llvm/Support/Compiler.h Wed Dec 4 19:03:23 2013
@@ -404,8 +404,10 @@
#endif
/// \brief Does the compiler support generalized initializers (using braced
-/// lists and std::initializer_list).
-#if __has_feature(cxx_generalized_initializers)
+/// lists and std::initializer_list). While clang may claim it supports general
+/// initializers, if we're using MSVC's headers, we might not have a usable
+/// std::initializer list type from the STL. Disable this for now.
+#if __has_feature(cxx_generalized_initializers) && !defined(_MSC_VER)
#define LLVM_HAS_INITIALIZER_LISTS 1
#else
#define LLVM_HAS_INITIALIZER_LISTS 0
More information about the llvm-commits
mailing list