diff options
author | Eric Fiselier <eric@efcs.ca> | 2019-06-13 00:37:25 +0000 |
---|---|---|
committer | Eric Fiselier <eric@efcs.ca> | 2019-06-13 00:37:25 +0000 |
commit | 5de7cacf0797df58f5a252d89c0b5606f03cb4a2 (patch) | |
tree | ee58c550276b4e5eac033a40be54f0134b5232d8 | |
parent | b2f45ba1e8ace7fc5d5298c55fc84573823270d6 (diff) | |
download | bcm5719-llvm-5de7cacf0797df58f5a252d89c0b5606f03cb4a2.tar.gz bcm5719-llvm-5de7cacf0797df58f5a252d89c0b5606f03cb4a2.zip |
Make GCC in C++03 Unsupported
Summary:
This patch make G++03 explicitly unsupported with libc++, as discussed on the mailing lists.
Below is the rational for this decision.
----------------------------------------------------------------------------------------------------
libc++ claims to support GCC with C++03 ("G++03"), and this is a problem for our users.
Our C++03 users are all using Clang. They must be. Less than 9% of the C++03 tests pass with GCC [1][2]. No non-trivial C++ program could work.
Attempting to support G++03 impacts our QoI considerably. Unlike Clang, G++03 offers almost no C++11 extensions. If we could remove all the fallbacks for G++03, it would mean libc++ could::
* Improve Correctness:
Every `#ifdef _LIBCPP_HAS_NO_<C++11-feature>` is a bug manifest. It exists to admit for deviant semantics.
* Achieve ABI stability between C++03 and C++11
Differences between our C++03 and C++Rest branches contain ABI bugs. For example `std::nullptr_t` and `std::function::operator()(...)` are currently incompatible between C++11 and C++03, but could be fixed.
* Decrease Compile Times and Memory Usage:
Writing efficient SFINAE requires C++11. Using alias templates, libc++ could reduce the number of instantiations it produces substantially.
* Decrease Binary Size
Similar to the last point, G++03 forces metaprogramming techniques that emit more debug information [3] [4]. Compared to libstdc++, debug information size increases of +10% are not uncommon.
Reviewers: ldionne, mclow.lists, EricWF
Reviewed By: ldionne, EricWF
Subscribers: zoecarver, aprantl, dexonsmith, arphaman, libcxx-commits, #libc
Differential Revision: https://reviews.llvm.org/D63154
llvm-svn: 363219
-rw-r--r-- | libcxx/docs/index.rst | 4 | ||||
-rw-r--r-- | libcxx/include/__config | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/libcxx/docs/index.rst b/libcxx/docs/index.rst index e2aca72edd5..04df9cfcc4a 100644 --- a/libcxx/docs/index.rst +++ b/libcxx/docs/index.rst @@ -101,9 +101,9 @@ Linux i386, x86_64 Clang, GCC libc++abi The following minimum compiler versions are strongly recommended. * Clang 3.5 and above -* GCC 4.7 and above. +* GCC 5.0 and above. -Anything older *may* work. +The C++03 dialect is only supported for Clang compilers. C++ Dialect Support --------------------- diff --git a/libcxx/include/__config b/libcxx/include/__config index ef2795b483a..f68baa3e3b9 100644 --- a/libcxx/include/__config +++ b/libcxx/include/__config @@ -187,6 +187,10 @@ #define _LIBCPP_CLANG_VER 0 #endif +#if defined(_LIBCPP_COMPILER_GCC) && __cplusplus < 201103L +#error "libc++ does not support using GCC with C++03. Please enable C++11" +#endif + // FIXME: ABI detection should be done via compiler builtin macros. This // is just a placeholder until Clang implements such macros. For now assume // that Windows compilers pretending to be MSVC++ target the Microsoft ABI, |