From 6e2c745e992c0aab1a1eeda7c3cf279a591e1b94 Mon Sep 17 00:00:00 2001 From: Logan Chien Date: Wed, 19 Feb 2014 15:04:29 +0000 Subject: [PATCH] Disable override and final C++ keyword in gcc 4.6. According to http://gcc.gnu.org/projects/cxx0x.html, override and final keyword was added in gcc 4.7. Thus, we should not use these keywords in gcc 4.6 even when __GXX_EXPERIMENTAL_CXX0X__ is available. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201679 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Support/Compiler.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/llvm/Support/Compiler.h b/include/llvm/Support/Compiler.h index a6b5687d505..49f29954349 100644 --- a/include/llvm/Support/Compiler.h +++ b/include/llvm/Support/Compiler.h @@ -152,7 +152,8 @@ /// 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) || \ - defined(__GXX_EXPERIMENTAL_CXX0X__) || LLVM_MSC_PREREQ(1700) + (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GNUC_PREREQ(4, 7)) || \ + LLVM_MSC_PREREQ(1700) #define LLVM_FINAL final #else #define LLVM_FINAL @@ -161,7 +162,8 @@ /// 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) || \ - defined(__GXX_EXPERIMENTAL_CXX0X__) || LLVM_MSC_PREREQ(1700) + (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GNUC_PREREQ(4, 7)) || \ + LLVM_MSC_PREREQ(1700) #define LLVM_OVERRIDE override #else #define LLVM_OVERRIDE -- 2.34.1