From 74a990b16c0206a6d1caa4dbac9f965b690614da Mon Sep 17 00:00:00 2001 From: Alp Toker Date: Fri, 3 Jan 2014 05:00:46 +0000 Subject: [PATCH] Enable LLVM_FINAL, LLVM_OVERRIDE and LLVM_HAS_VARIADIC_TEMPLATES with more gcc and MSVC versions The 'sealed' definition of LLVM_FINAL can be dropped once VS 2010 is decommissioned. Some of this is speculative so will keep an eye on the waterfall -- ping me if you see failures. Incremental work towards C++11 migration. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198399 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Support/Compiler.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/include/llvm/Support/Compiler.h b/include/llvm/Support/Compiler.h index 6e840898c45..413260f2326 100644 --- a/include/llvm/Support/Compiler.h +++ b/include/llvm/Support/Compiler.h @@ -107,7 +107,7 @@ /// \brief Does this compiler support variadic templates. /// /// Implies LLVM_HAS_RVALUE_REFERENCES and the existence of std::forward. -#if __has_feature(cxx_variadic_templates) +#if __has_feature(cxx_variadic_templates) || LLVM_MSC_PREREQ(1800) # define LLVM_HAS_VARIADIC_TEMPLATES 1 #else # define LLVM_HAS_VARIADIC_TEMPLATES 0 @@ -151,15 +151,19 @@ /// LLVM_FINAL - Expands to 'final' if the compiler supports it. /// Use to mark classes or virtual methods as final. -#if __has_feature(cxx_override_control) || LLVM_MSC_PREREQ(1700) +#if __has_feature(cxx_override_control) || \ + defined(__GXX_EXPERIMENTAL_CXX0X__) || LLVM_MSC_PREREQ(1700) #define LLVM_FINAL final +#elif LLVM_MSC_PREREQ(1600) +#define LLVM_FINAL sealed #else #define LLVM_FINAL #endif /// LLVM_OVERRIDE - Expands to 'override' if the compiler supports it. /// Use to mark virtual methods as overriding a base class method. -#if __has_feature(cxx_override_control) || LLVM_MSC_PREREQ(1700) +#if __has_feature(cxx_override_control) || \ + defined(__GXX_EXPERIMENTAL_CXX0X__) || LLVM_MSC_PREREQ(1600) #define LLVM_OVERRIDE override #else #define LLVM_OVERRIDE -- 2.34.1