[llvm] r198142 - Enable deleted functions and explicit conversions in MSVC 2013
Alp Toker
alp at nuanti.com
Sat Dec 28 16:49:14 PST 2013
Author: alp
Date: Sat Dec 28 18:49:14 2013
New Revision: 198142
URL: http://llvm.org/viewvc/llvm-project?rev=198142&view=rev
Log:
Enable deleted functions and explicit conversions in MSVC 2013
Also prospectively enable static_assert as the documentation suggests it's been
available since MSVC 2010. Let's see if the build servers agree.
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=198142&r1=198141&r2=198142&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/Compiler.h (original)
+++ llvm/trunk/include/llvm/Support/Compiler.h Sat Dec 28 18:49:14 2013
@@ -136,8 +136,7 @@
/// ...
/// };
#if (__has_feature(cxx_deleted_functions) \
- || defined(__GXX_EXPERIMENTAL_CXX0X__))
- // No version of MSVC currently supports this.
+ || defined(__GXX_EXPERIMENTAL_CXX0X__)) || LLVM_MSC_PREREQ(1800)
#define LLVM_DELETED_FUNCTION = delete
#else
#define LLVM_DELETED_FUNCTION
@@ -379,7 +378,7 @@
/// \brief Expands to explicit on compilers which support explicit conversion
/// operators. Otherwise expands to nothing.
#if (__has_feature(cxx_explicit_conversions) \
- || defined(__GXX_EXPERIMENTAL_CXX0X__))
+ || defined(__GXX_EXPERIMENTAL_CXX0X__)) || LLVM_MSC_PREREQ(1800)
#define LLVM_EXPLICIT explicit
#else
#define LLVM_EXPLICIT
@@ -387,7 +386,7 @@
/// \macro LLVM_STATIC_ASSERT
/// \brief Expands to C/C++'s static_assert on compilers which support it.
-#if __has_feature(cxx_static_assert)
+#if __has_feature(cxx_static_assert) || LLVM_MSC_PREREQ(1600)
# define LLVM_STATIC_ASSERT(expr, msg) static_assert(expr, msg)
#elif __has_feature(c_static_assert)
# define LLVM_STATIC_ASSERT(expr, msg) _Static_assert(expr, msg)
More information about the llvm-commits
mailing list