[PATCH] D16751: Enable constexpr on Visual Studio 2015, add support for two equivalent attributes

Aaron Ballman via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 1 07:07:15 PST 2016

aaron.ballman added reviewers: rnk, majnemer.
aaron.ballman added subscribers: majnemer, rnk.
aaron.ballman added a comment.

Generally LGTM, but adding @rnk and @majnemer for an extra opinion on MSVC's constexpr-readiness.

Comment at: C:/LLVM/llvm/include/llvm/Support/Compiler.h:95
@@ -94,3 +94,3 @@
-#if __has_feature(cxx_constexpr) || defined(__GXX_EXPERIMENTAL_CXX0X__)
+#if __has_feature(cxx_constexpr) || defined(__GXX_EXPERIMENTAL_CXX0X__) || LLVM_MSC_PREREQ(1900)
 # define LLVM_CONSTEXPR constexpr
I think this is reasonable, but we may still get some failures depending on usage. MSVC's constexpr support is drastically improved in MSVC 2015, but is not C++14 constexpr, it's C++11 constexpr.


More information about the llvm-commits mailing list