Summary:
Starting in Clang 8.0 and GCC 8.0, `alignof` and `__alignof` return different values in same cases. Specifically `alignof` and `_Alignof` return the minimum alignment for a type, where as `__alignof` returns the preferred alignment. libc++ currently uses `__alignof` but means to use `alignof`. See llvm.org/PR39713
This patch introduces the macro `_LIBCPP_ALIGNOF` so we can control which spelling gets used.
This patch does not introduce any ABI guard to provide the old behavior with newer compilers. However, if we decide that is needed, this patch makes it trivial to implement.
I think we should commit this change immediately, and decide what we want to do about the ABI afterwards.
Reviewers: ldionne, EricWF
Reviewed By: EricWF
Subscribers: christof, libcxx-commits
Differential Revision: https://reviews.llvm.org/D54814
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347787 91177308-0d34-0410-b5e6-96231b3b80d8
Summary:
std::dynarray had been proposed for C++14, but it was pulled out from C++14
and there are no plans to standardize it anymore.
Reviewers: mclow.lists, EricWF
Subscribers: mgorny, christof, jkorous, dexonsmith, arphaman, libcxx-commits
Differential Revision: https://reviews.llvm.org/D54801
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347783 91177308-0d34-0410-b5e6-96231b3b80d8
Summary:
When the Xcode Command Line tools are not installed but CMAKE_OSX_SYSROOT is
set, we would try to re-export symbols from the libc++abi.dylib shipped in
the sysroot, which does not exist. This commit changes the build on OS X to
always re-export symbols from the explicit re-export lists, which doesn't
change depending on what system you're building on, and is therefore much
less flaky.
Reviewers: EricWF, mclow.lists
Subscribers: mgorny, christof, jkorous, dexonsmith, libcxx-commits
Differential Revision: https://reviews.llvm.org/D54595
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347708 91177308-0d34-0410-b5e6-96231b3b80d8
This attribute should appear only on the first declaration. This
patch cleans up <string> by removing the attribute on redeclarations.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347608 91177308-0d34-0410-b5e6-96231b3b80d8
This patch adds an implementation of __resize_default_init as
described in P1072R2. Additionally, it uses it in filesystem to
demonstrate its intended utility.
Once P1072 lands, or if it changes it's interface, I will adjust
the internal libc++ implementation to match.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347589 91177308-0d34-0410-b5e6-96231b3b80d8
In r339743, I marked several aligned allocation tests as downright
unsupported on macosx in an attempt to unbreak the build. It turns
out that marking them as unuspported whenever we're on OS X is way
too coarse grained. This commit marks the tests as XFAIL with more
granularity.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347585 91177308-0d34-0410-b5e6-96231b3b80d8
The test was marked as failing whenever the deployment target was 10.12
or older, but in reality the test passes when the deployment target is
10.12 on recent Clangs. This happens because only older clangs do not
honor the -faligned-allocation flag, which disables any availability
error related to aligned allocation support, regardless of the
deployment target.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347580 91177308-0d34-0410-b5e6-96231b3b80d8
Summary:
In PR39232, we noticed that some variant tests started failing in C++2a mode
with recent Clangs, because the rules for literal types changed in C++2a. As
a result, a temporary fix was checked in (enabling the test only in C++17).
This commit is what I believe should be the long term fix: I removed the
tests that checked constexpr default-constructibility with a weird type
from the tests for index() and valueless_by_exception(), and instead I
added tests for those using an obviously literal type in the test for the
default constructor.
Reviewers: EricWF, mclow.lists
Subscribers: christof, jkorous, dexonsmith, arphaman, libcxx-commits, rsmith
Differential Revision: https://reviews.llvm.org/D54767
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347568 91177308-0d34-0410-b5e6-96231b3b80d8
This is a revert of r347421, except I'm using the with_system_cxx_lib
lit feature instead of availability to mark the test as unsupported
(because the problem is a bug in the dylib itself). In r347421, I said
I wasn't able to reproduce the issue and that's why I was removing it:
this was because I ran lit slightly wrong. The problem mentioned really
exists.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347475 91177308-0d34-0410-b5e6-96231b3b80d8
We used to print a Python list corresponding to the command. It is more
useful to print the joined string so it can be copy/pasted directly when
a test fails.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347471 91177308-0d34-0410-b5e6-96231b3b80d8
We don't support mac OS 10.6 and older anymore, so this macro can never
be defined. This bit of code had been added in D28931 as a fix for
PR31448, but it doesn't seem necessary anymore.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347427 91177308-0d34-0410-b5e6-96231b3b80d8
The iterator types for different specializations of containers with the
same element type but different allocators are not required to be
convertible. This patch makes the test to take the iterator type from
the same container specialization as the created container.
Reviewed as https://reviews.llvm.org/D54806.
Thanks to Andrey Maksimov for the patch.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347423 91177308-0d34-0410-b5e6-96231b3b80d8
I wasn't able to reproduce the issue referred to by the comment using
the libc++'s shipped with mac OS X 10.7 and 10.8, so I assume this may
have been fixed in a function that is now shipped in the headers. In
that case, the tests will pass no matter what dylib we're using.
In the worst case, some test bots will start failing and I'll understand
why I was wrong, and I can create an actual lit feature for it. Note
that I could just leave this test alone, but this change is on the path
towards eradicating vendor-specific availability markup from the test
suite.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347421 91177308-0d34-0410-b5e6-96231b3b80d8
Otherwise, Clang complains about internal_linkage not being applied to the
first declaration of the operator (and rightfully so).
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347400 91177308-0d34-0410-b5e6-96231b3b80d8
r347395 changed the ABI list on Linux, but two of those symbols are still
being exported from the shared object:
_ZSt18make_exception_ptrINSt3__112future_errorEESt13exception_ptrT_
_ZNSt3__1plIcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_PKS6_
This commit makes sure those symbols are not exported, as they should be.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347399 91177308-0d34-0410-b5e6-96231b3b80d8
Summary:
This commit marks a few functions as hidden and removes them from the ABI list
on Linux such that libc++ can be built with -fvisibility=hidden. The functions
marked as hidden by this patch were exported from the shared object only
because they were implicitly instantiated function templates. It is safe
to stop exporting those symbols from the shared object because nobody could
actually depend on them: implicit instantiations are not taken from shared
objects.
The symbols removed in this commit are basically the same that had been
removed in https://reviews.llvm.org/D53868, but that patch had to be reverted
because it broke the build (because the functions were not marked as hidden
like this patch does).
Reviewers: EricWF, mclow.lists
Subscribers: christof, jkorous, dexonsmith, libcxx-commits
Differential Revision: https://reviews.llvm.org/D54639
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347395 91177308-0d34-0410-b5e6-96231b3b80d8
Summary:
Benchmarks for std::sort, std::stable_sort, std::make_heap,
std::sort_heap, std::pop_heap and std::push_heap.
The benchmarks are run with integers and strings, and with different
sorted input.
Reviewers: EricWF
Subscribers: christof, mgrang, ldionne, libcxx-commits
Differential Revision: https://reviews.llvm.org/D53978
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347329 91177308-0d34-0410-b5e6-96231b3b80d8
The XFAIL started passing since we're only testing for trivial-copyability of
reference_wrapper in C++14 and above. This commit constrains the XFAIL to
gcc-4.9 with C++14 (it would also fail on C++17 and above, but those standards
are not available with GCC 4.9).
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347264 91177308-0d34-0410-b5e6-96231b3b80d8
Some tests use type std::max_align_t, but don't include <cstddef> header
directly. As a result, these tests won't compile against some conformant
libraries.
Reviewed as https://reviews.llvm.org/D54645.
Thanks to Andrey Maksimov for the patch.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347232 91177308-0d34-0410-b5e6-96231b3b80d8
A bunch of unordered containers tests call library functions but don't directly
include the corresponding header files:
- fabs() (defined in <cmath> which is not included);
- is_permutation() (defined in <algorithm> which is not included);
- next() (defined in <iterator> which is not included).
- As a result, these tests won't compile against some conformant libraries.
Reviewed as https://reviews.llvm.org/D54643.
Thanks to Andrey Maksimov for the patch.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347085 91177308-0d34-0410-b5e6-96231b3b80d8
I also kept the original "vague" documentation that saying that users are
responsible for not breaking us. This doesn't mean anything because there's
no way they can actually enforce that unless we restrict ourselves to a
specific naming scheme, but I left the documentation because it acts as a
good warning and gives us more leeway.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347052 91177308-0d34-0410-b5e6-96231b3b80d8