summaryrefslogtreecommitdiff
path: root/include/llvm/Support
diff options
context:
space:
mode:
authorLogan Chien <tzuhsiang.chien@gmail.com>2014-02-19 15:04:29 +0000
committerLogan Chien <tzuhsiang.chien@gmail.com>2014-02-19 15:04:29 +0000
commit6e2c745e992c0aab1a1eeda7c3cf279a591e1b94 (patch)
treec7f19291eb456ca82bc0091773f65a71fefe9c81 /include/llvm/Support
parent9a925861144fba3497f4b6142cdaa70807e3f1e3 (diff)
downloadllvm-6e2c745e992c0aab1a1eeda7c3cf279a591e1b94.tar.gz
llvm-6e2c745e992c0aab1a1eeda7c3cf279a591e1b94.tar.bz2
llvm-6e2c745e992c0aab1a1eeda7c3cf279a591e1b94.tar.xz
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
Diffstat (limited to 'include/llvm/Support')
-rw-r--r--include/llvm/Support/Compiler.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/llvm/Support/Compiler.h b/include/llvm/Support/Compiler.h
index a6b5687d50..49f2995434 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