This reverts commit 75746a3228.
Bug: 72411393
Test: normal build, and build with clang 7.0 in system/core/demangle
Change-Id: I6c67b5210e131600ad9706afd2e1cbd7f7f40237
Summary:
This patch improves how libc++ handles min/max macros within the headers. Previously libc++ would undef them and emit a warning.
This patch changes libc++ to use `#pragma push_macro` to save the macro before undefining it, and `#pragma pop_macro` to restore the macros and the end of the header.
Reviewers: mclow.lists, bcraig, compnerd, EricWF
Reviewed By: EricWF
Subscribers: cfe-commits, krytarowski
Differential Revision: https://reviews.llvm.org/D33080
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304357 91177308-0d34-0410-b5e6-96231b3b80d8
On Windows, marking an `extern template class` declaration as exported
actually forces an instantiation, which is not the desired behavior.
Instead, the actual explicit instantiations need to be exported.
Differential Revision: https://reviews.llvm.org/D24679
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@281925 91177308-0d34-0410-b5e6-96231b3b80d8
Summary:
After putting this question up on cfe-dev I have decided that it would be best to allow the use of `<atomic>` in C++03. Although static initialization is a concern the syntax required to get it is C++11 only. Meaning that C++11 constant static initialization cannot silently break in C++03, it will always cause a syntax error. Furthermore `ATOMIC_VAR_INIT` and `ATOMIC_FLAG_INIT` remain defined in C++03 even though they cannot be used because C++03 usages will cause better error messages.
The main change in this patch is to replace `__has_feature(cxx_atomic)`, which only returns true when C++ >= 11, to `__has_extension(c_atomic)` which returns true whenever clang supports the required atomic builtins.
This patch adds the following macros:
* `_LIBCPP_HAS_C_ATOMIC_IMP` - Defined on clang versions which provide the C `_Atomic` keyword.
* `_LIBCPP_HAS_GCC_ATOMIC_IMP` - Defined on GCC > 4.7. We must use the fallback atomic implementation.
* `_LIBCPP_HAS_NO_ATOMIC_HEADER` - Defined when it is not safe to include `<atomic>`.
`_LIBCPP_HAS_C_ATOMIC_IMP` and `_LIBCPP_HAS_GCC_ATOMIC_IMP` are mutually exclusive, only one should be defined. If neither is defined then `<atomic>` is not implemented and including `<atomic>` will issue an error.
Reviewers: chandlerc, jroelofs, mclow.lists
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D11555
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@245463 91177308-0d34-0410-b5e6-96231b3b80d8
The bionic tests on x86_64 are very unhappy about this:
external/gtest/include/gtest/gtest-printers.h:245: error: undefined reference to 'std::__1::basic_ostream<char, std::__1::char_traits<char> >::operator<<(__float128)'
external/gtest/include/gtest/gtest-printers.h:245: error: undefined reference to 'std::__1::basic_ostream<char, std::__1::char_traits<char> >::operator<<(__float128)'
external/gtest/include/gtest/gtest-printers.h:245: error: undefined reference to 'std::__1::basic_ostream<char, std::__1::char_traits<char> >::operator<<(__float128)'
external/gtest/include/gtest/gtest-printers.h:245: error: undefined reference to 'std::__1::basic_ostream<char, std::__1::char_traits<char> >::operator<<(__float128)'
I'll investigate tomorrow, but for now it's easiest to just revert.
This reverts commit 98c4e404ca.
Change-Id: I4c4e83be2ca465069734c54f4dcfa539916d35e4
This rebase skips the following patches in upstream:
+ 37025e1b32
Make the helper routines in string really be constexpr. This required a
bit of refacoring in algorithm as well. Give them better names while
we're at it. All of these are internal rotines; no visible functionality
change.
+ 164b297099
Implement string_view from the library fundamentals TS (n4023). Also
works in C++11 and 03, with reduced functionality (mostly in the area of
constexpr)
+ e4694b4129
Formatting improvements in the <string_view> synopsis suggested by
RSmith. No functionality change.
+ 3a61b30f3a
Minor cleanup for string_view; mostly from suggestions by Richard Smith.
Also, make the tests pass under c++03
+ 484728789e
string_view enhancements. Move to the correct namespace. Better
constexpr support (thanks to Richard for the suggestions). Update the
tests to match this. Add <experimental/__config for experimental
macros/etc to live.
+ b1a40264dc
[libcxx] Add <experimental/utility> header for LFTS.
+ 3ee7233c80
[libcxx] expose experimental::erased_type for all standard versions.
+ 67740670f9
NFC. Remove trailing whitespace and tabs.
+ b9536101dc
NFC. Move definition of _LIBCPP_ASSERT into __debug header and remove
external include guards.
+ 98c4e404ca.
Revert "Turn off extern templates for most uses."
Bug: 17255369
Change-Id: I629ff16275d50e4cc8767b253a2c0542468348d8
Turning off explicit template instantiation leads to a pretty
significant build time and code size cost. We're better off dealing
with ABI incompatibility issues that come up in a less heavy handed
way.
This reverts commit r189610.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215740 91177308-0d34-0410-b5e6-96231b3b80d8
[syserr.errcat.objects]p4 specifies that
system_category().default_error_condition(ev) map to
error_condition(posv, generic_category()) if ev could map to a POSIX
errno.
Linux reserves up to and including 4095 for errno values, use this as a
bound.
This fixes syserr.errcat.objects/system_category.pass.cpp on Linux.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@209795 91177308-0d34-0410-b5e6-96231b3b80d8
[syserr.errcat.objects]p4 specifies that
system_category().default_error_condition(ev) map to
error_condition(posv, generic_category()) if ev could map to a POSIX
errno.
Linux reserves up to and including 4095 for errno values, use this as a
bound.
This fixes syserr.errcat.objects/system_category.pass.cpp on Linux.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@209795 91177308-0d34-0410-b5e6-96231b3b80d8