[llvm] r201679 - Disable override and final C++ keyword in gcc 4.6.

Logan Chien tzuhsiang.chien at gmail.com
Wed Feb 19 07:04:29 PST 2014


Author: logan
Date: Wed Feb 19 09:04:29 2014
New Revision: 201679

URL: http://llvm.org/viewvc/llvm-project?rev=201679&view=rev
Log:
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.

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=201679&r1=201678&r2=201679&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/Compiler.h (original)
+++ llvm/trunk/include/llvm/Support/Compiler.h Wed Feb 19 09:04:29 2014
@@ -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





More information about the llvm-commits mailing list