Things done in this patch:
1. Make __debug include __config since it uses macros from it.
2. The current method of defining _LIBCPP_ASSERT is prone to redefinitions. Move
the null _LIBCPP_ASSERT definition into the __debug header to prevent this.
3. Remove external <__debug> include gaurds. <__debug> guards almost all of its
contents internally. There is no reason to be doing it externally.
This patch should not change any functionality.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215332 91177308-0d34-0410-b5e6-96231b3b80d8
gcc 4.7 and above has atomic built-ins which slightly different APIs
from those provided by clang. Add proxy functions that wrap the gcc
built-ins to produce a symbol that is API equivalent to the clang
built-ins. This allows libc++'s atomic library to be used with gcc-4.7
and newer.
Patch contributed by Albert Wong.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215305 91177308-0d34-0410-b5e6-96231b3b80d8
Summary: This patch moves the SFINAE for __is_destructor_welformed out of the function template parameters. type_traits must compile in c++03 mode since it is included in c++03 headers.
Test Plan: No tests have been added.
Reviewers: danalbert, mclow.lists
Reviewed By: danalbert
Subscribers: K-ballo, cfe-commits
Differential Revision: http://reviews.llvm.org/D4735
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@214422 91177308-0d34-0410-b5e6-96231b3b80d8
__get_classname() and __bracket_expression were assuming that
char_class_type was ctype_base::mask rather than using
regex_traits<_CharT>::char_class_type.
This change allows char_class_type to be defined to something other than
ctype_base::mask so that the implementation will still work for
platforms with an 8-bit ctype mask (such as Android and OpenBSD).
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@214201 91177308-0d34-0410-b5e6-96231b3b80d8
Summary: The polymorphic allocator implementation would greatly benefit by defining virtual functions in the dynlib instead of inline. In order to do that some types are going to have to be available outside of c++1y. This is the first step.
Reviewers: mclow.lists, EricWF
Reviewed By: EricWF
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D4554
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@213889 91177308-0d34-0410-b5e6-96231b3b80d8
Android's ctype implementation comes from openbsd, which for some reason
doesn't consider numbers to be hex digits.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@213785 91177308-0d34-0410-b5e6-96231b3b80d8
std::make_heap is currently implemented by iteratively applying a
siftup-type algorithm. Since sift-up is O(ln n), this gives
std::make_heap a worst case time complexity of O(n ln n).
The C++ standard mandates that std::make_heap make no more than O(3n)
comparisons, this makes our std::make_heap out of spec.
Fix this by introducing an implementation of __sift_down and switch
std::make_heap to create the heap using it.
This gives std::make_heap linear time complexity in the worst case.
This fixes PR20161.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@213615 91177308-0d34-0410-b5e6-96231b3b80d8
Summary:
This patch adds the `<experimental/utility>` header as specified in the latest draft of the library fundamentals TS.
`<experimental/utility>` only contains `class erased_type`.
This patch also updates the documentation to list the `erased_type` class as "initial implementation complete".
Test Plan:
Three test cases where added:
1. Test that `_LIBCPP_VERSION` is defined.
2. Test that `<utility>` has been included.
3. Test that `erased_type` is in the correct namespace and is constexpr default constructible.
Reviewers: mclow.lists
Reviewed By: mclow.lists
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D4510
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@213226 91177308-0d34-0410-b5e6-96231b3b80d8
Mark the base classes for time_get_byname and time_get as _LIBCPP_TYPE_VIS_ONLY
rather than _LIBCPP_TYPE_VIS. These base classes are templated types and cannot
be stored with export dll storage.
Fixes compilation with _LIBCPP_DLL for Windows when the time_get and
time_get_byname classes are used.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@213116 91177308-0d34-0410-b5e6-96231b3b80d8
libc++ currently relies on undefined initialization order of global
initializers when using gcc:
1. __start_std_streams in iostream.cpp calls locale:🆔:_init, which assigns
an id to each locale::facet in an initializer
2. Every facet has a static locale::id id, whose constructor sets the facet's
id to 0
If 2 runs after 1, it clobbers the facet's assigned consecutive id, causing
exceptions to be thrown when e.g. running code like "cout << endl".
To fix this, let _LIBCPP_CONSTEXPR evaluate to "constexpr" instead of nothing
with gcc. locale::id's constructor is marked _LIBCPP_CONSTEXPR, which ensures
that it won't get an initializer that could potentially run after the
iostream.cpp initializer. (This remains broken when building with msvc.)
Also switch constexpr-specific code in bitset to use __SIZEOF_SIZE_T__ instead
of __SIZE_WIDTH__, because gcc doesn't define the latter.
Pair-programmed/debugged with Dana Jansens.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@210188 91177308-0d34-0410-b5e6-96231b3b80d8
(clang doesn't complain about this, but gcc does. This is necessary for a
follow-up patch that will enable _LIBCPP_CONSTEXPR for gcc.)
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@209888 91177308-0d34-0410-b5e6-96231b3b80d8
r207606 changed the __need_foo macros to behave like they do with gcc: If they
are set, _only_ the __need_foo stuff gets defined. As a consequence, cstddef
no longer defined "offsetof". It looks like the __need_foo defines aren't
needed anymore, so just remove them.
Fixes PR19723.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@208942 91177308-0d34-0410-b5e6-96231b3b80d8