[llvm] r201679 - Disable override and final C++ keyword in gcc 4.6.
Aaron Ballman
aaron at aaronballman.com
Wed Feb 19 07:27:45 PST 2014
Since our min supported compiler version is 4.7 (as of llvm 3.4), I
don't believe this commit really makes sense. Since we're trying to
make the switch to using C++11 functionality, I don't think we want to
add support for older compilers which will fail in other ways.
~Aaron
On Wed, Feb 19, 2014 at 10:04 AM, Logan Chien <tzuhsiang.chien at gmail.com> wrote:
> 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
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list