Commit Graph

3306 Commits

Author SHA1 Message Date
Roger Ferrer Ibanez
d3584d51a2 Reverting wrong diff
I managed to confuse me with two reviews of the same thing and ended commiting the wrong one.



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287868 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-24 11:28:02 +00:00
Roger Ferrer Ibanez
01b9f8a698 Protect tests for std::uninitialized_{copy,fill} under libcpp-no-exceptions
Skip tests that expect an exception be thrown.

Differential Revision: https://reviews.llvm.org/D26606



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287866 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-24 11:17:09 +00:00
Roger Ferrer Ibanez
37a0d7cb33 Protect std::string tests under libcpp-no-exceptions
Skip tests that expect an exception be thrown and/or disable
unreachable catch handlers.

Differential Revision: https://reviews.llvm.org/D26608



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287865 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-24 11:15:09 +00:00
Stephan T. Lavavej
e33c0b01f8 [libcxx] [test] D27027: Strip trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287829 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-23 22:03:28 +00:00
Stephan T. Lavavej
39245fe351 [libcxx] [test] D27026: Fix copy-paste silliness; ULL can't ever be 32-bit.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287828 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-23 22:02:59 +00:00
Stephan T. Lavavej
50fe47bc8b [libcxx] [test] D27020: Fix MSVC warning C4245 "conversion from 'X' to 'Y', signed/unsigned mismatch", part 7/12.
When initializing unsigned integers to their maximum values, change "const T M(~0);" to "const T M(static_cast<T>(-1));".

~0 and -1 are equivalent, but I consider the -1 form to be significantly clearer (and more consistent with other tests).

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287827 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-23 22:02:53 +00:00
Stephan T. Lavavej
12f7f5d247 [libcxx] [test] D27019: Fix MSVC warning C4245 "conversion from 'X' to 'Y', signed/unsigned mismatch", part 6/12.
Add static_cast when initializing unsigned integers with negative numbers (in order to obtain big values).

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287826 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-23 22:02:44 +00:00
Stephan T. Lavavej
bdf8bae8bb [libcxx] [test] D27018: Fix MSVC warning C4018 "signed/unsigned mismatch", part 5/12.
Various changes:

test/std/algorithms/alg.sorting/alg.binary.search/binary.search/binary_search.pass.cpp
Change M from unsigned to int. It's compared against "int x",
and we binary_search() for it within a vector<int>.

test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.f/eval.pass.cpp
test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.f/eval_param.pass.cpp
Add static_cast<unsigned> when comparing int to unsigned.

test/std/strings/basic.string/string.cons/size_char_alloc.pass.cpp
Change unsigned indices to int when we're being given int as a bound.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287825 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-23 22:02:35 +00:00
Stephan T. Lavavej
ed55db243e [libcxx] [test] D27016: Fix MSVC warning C4018 "signed/unsigned mismatch", part 4/12.
Change "int j;" indices to "std::size_t j;".

Also, include <cstddef> when it wasn't already being included.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287824 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-23 22:02:27 +00:00
Stephan T. Lavavej
9a65a47871 [libcxx] [test] D27015: Fix MSVC warning C4018 "signed/unsigned mismatch", part 3/12.
Change unsigned to int in parameters.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287823 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-23 22:02:16 +00:00
Stephan T. Lavavej
388c2a8e68 [libcxx] [test] D27014: Fix MSVC warning C4018 "signed/unsigned mismatch", part 2/12.
Add static_cast<std::size_t> when comparing int to std::size_t.

Also, include <cstddef> when it wasn't already being included.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287822 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-23 22:01:58 +00:00
Stephan T. Lavavej
a9bcd3dae8 [libcxx] [test] D27013: Fix MSVC warning C4018 "signed/unsigned mismatch", part 1/12.
Change loop indices from int to std::size_t.

Also, include <cstddef> when it wasn't already being included.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287820 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-23 22:01:19 +00:00
Shoaib Meenai
634ff013be [libc++] Remove unneeded visibility pragmas
The function definitions being guarded by the pragma were all static, so
they wouldn't be exported anyway. In any case, we should prefer the
visibility macros. No functional change.

Differential Revision: https://reviews.llvm.org/D26940

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287768 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-23 16:11:15 +00:00
Eric Fiselier
e041941007 Fix __hash_table::max_size() on 32 bit systems
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287749 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-23 09:16:12 +00:00
Casey Carter
80888fa0fe Don't "LIBCPP_ONLY(stuff;)" at namespace scope.
Differential review: https://reviews.llvm.org/D27029

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287732 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-23 01:44:53 +00:00
Eric Fiselier
ef3060ef96 [libcxx] Fix max_size() across all containers
Summary: The `max_size()` method of containers should respect both the allocator's reported `max_size` and the range of the `difference_type`. This patch makes all containers choose the smallest of those two values.

Reviewers: mclow.lists, EricWF

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D26885

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287729 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-23 01:18:56 +00:00
Eric Fiselier
0373708cdc Add <variant> tests but disable them for libc++
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287728 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-23 01:02:51 +00:00
Eric Fiselier
fb6164cdad Allow libc++ to use modules in C++03.
Libc++ internal uses <atomic> in C++03 code but the module map forbids its use.
This causes the libc++ 'std' module to fail to build in C++03.

This patch removes the requirement to fix this issue.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287693 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 20:15:39 +00:00
Eric Fiselier
6010dc84c6 Attempt to fix stdint/cstdint modules try 2
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287690 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 20:05:19 +00:00
Eric Fiselier
faa8312d51 Cleanup module.modulemap
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287687 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 20:00:21 +00:00
Eric Fiselier
8b4cb5ba98 Revert r287435 because of OS X test failures
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287531 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-21 11:26:10 +00:00
Eric Fiselier
487bc7e0c8 Mark variadic lock guard tests as XFAIL with modules, since they have to define macros to expose the new ABI
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287513 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-21 01:10:52 +00:00
Eric Fiselier
388ffe1db1 Adjust uses_alloc_types helpers for later changes
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287512 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-21 00:41:32 +00:00
Eric Fiselier
6f7f0b8530 Fix stdint/cstdint modules
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287435 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-19 03:29:03 +00:00
Eric Fiselier
887c80ec10 Mark test as unsupported in C++03
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287417 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-19 01:38:00 +00:00
Eric Fiselier
850745db9e [libcxx] Implement locale.h to fix modules build
Summary:
Because `locale.h` isn't part of the libc++ modules the class definitions it provides are exported as part of `__locale` (since it happens to be build first). This breaks `<clocale>` which exports `std::lconv` without including `<__locale>`.

This patch implements `locale.h` to fix this issue, it also adds support for testing libc++ with modules.




Reviewers: mclow.lists, rsmith, EricWF

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D26826

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287413 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-19 01:14:15 +00:00
Stephan T. Lavavej
2917004aed [libcxx] [test] D26812: In random tests, use real static_asserts and silence a warning.
In C++11 mode and newer, use real static_asserts.
In C++03 mode, min() and max() aren't constexpr, so use plain asserts.

One test triggers MSVC's warning C4310 "cast truncates constant value".
The code is valid, and yet the warning is valid, so I'm silencing it
through push-disable-pop.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287391 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-18 22:45:32 +00:00
Eric Fiselier
c044b03d26 Allow using libsupc++ with LIBCXX_ENABLE_STATIC_ABI_LIBRARY. Patch from Michael Daniels.
The code cannot currently link when using libsupc++ with the
LIBCXX_ENABLE_STATIC_ABI_LIBRARY option.

This change ifdef's out the the destructor and 'what' function for
bad_array_length and bad_array_new_length when GLIBCXX is defined.
The constructors that are left in are the only functions not being provided by
libsupc++ itself, and follows the same pattern that was used to ifdef bad_alloc.

Testing was done on a Linux x86_64 host using GCC 5.4 and libc++ from ToT.
I see no change to the test results when using libsup++ or libstdc++ without
LIBCXX_ENABLE_STATIC_ABI_LIBRARY. When using libsupc++ with
LIBCXX_ENABLE_STATIC_ABI_LIBRARY it will now build and test results are the
same as those without the option specified.

Reviewed as https://reviews.llvm.org/D26186


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287388 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-18 22:25:41 +00:00
Stephan T. Lavavej
0252201f9e [libcxx] [test] D26816: Fix non-Standard assumptions when testing sample().
sample() isn't specified with a reproducible algorithm, so expecting
exact output is non-Standard. Mark those tests with LIBCPP_ASSERT.

In test_small_population(), we're guaranteed to get all of the elements,
but not necessarily in their original order. When PopulationCategory is
forward, we're guaranteed stability (and can therefore test equal()).
Otherwise, we can only test is_permutation(). (As it happens, both libcxx
and MSVC's STL provide stability in this scenario for input-only iterators.)

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287383 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-18 21:54:43 +00:00
Stephan T. Lavavej
3ee8025384 [libcxx] [test] D26815: Fix an assumption about the state of moved-from std::functions.
The Standard doesn't provide any guarantees beyond "valid but unspecified" for
moved-from std::functions. libcxx moves from small targets and leaves them
there, while MSVC's STL empties out the source. Mark these assertions as
libcxx-specific.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287382 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-18 21:54:38 +00:00
Stephan T. Lavavej
cb9d881ca0 [libcxx] [test] D26813: allocator<const T> is non-Standard.
N4582 17.6.3.5 [allocator.requirements] says that allocators are given
cv-unqualified object types, and N4582 20.9.9 [default.allocator]
implies that allocator<const T> is ill-formed (due to colliding
address() overloads). Therefore, tests for allocator<const T>
should be marked as libcxx-specific (if not removed outright).

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287381 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-18 21:54:31 +00:00
Eric Fiselier
60479ea31b Make LIBCXX_ENABLE_STATIC_ABI_LIBRARY merge libc++.a and libc++abi.a
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287373 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-18 19:53:45 +00:00
Eric Fiselier
d3b197fcb5 Make merge_archives.py executable
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287337 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-18 11:29:05 +00:00
Eric Fiselier
fa054d2ad0 Add merge_archives.py utility
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287336 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-18 11:26:14 +00:00
Eric Fiselier
8c57032b52 Remove _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
libc++ no longer supports C++11 compilers that don't implement `= default`.
This patch removes all instances of the feature test macro
_LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS as well as the potentially dead code it hides.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287321 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-18 06:42:17 +00:00
Shoaib Meenai
f66194bce3 [libc++] Fix preprocessor guard for overload declaration
Fix a typo in the conditional.  Caught by going through list of removed
symbols when building with hidden visibility.

Differential Revision: https://reviews.llvm.org/D26825

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287309 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-18 04:31:09 +00:00
Eric Fiselier
91673636fb update Apples ABI list to ignore non-std symbols
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287301 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-18 02:36:58 +00:00
Eric Fiselier
0d6941834c Change sym_check to filter non-stdlib symbols.
Currently sym_check almost all names found in the binary, including those
which are defined in other libraries. This makes our ABI lists harder to maintain.

This patch adds a --only-stdlib-symbols option to sym_check which removes
all symbols which aren't possibly provided by libc++. It also re-generates
the linux ABI list after making this change.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287294 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-18 01:40:20 +00:00
Eric Fiselier
a93ebeca94 Workaround compilers w/o C++1z inline variables
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287255 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-17 20:08:43 +00:00
Eric Fiselier
c0ccadbd90 Remove files missed in r287250
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287251 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-17 19:24:34 +00:00
Eric Fiselier
8d33526db2 Implement P0504R0: Revisiting in-place tag types for any/optional/variant
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287250 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-17 19:24:04 +00:00
Eric Fiselier
77dabb302b Test changes for P0504R0 "Revisiting in-place tag types for any/optional/variant". Patch from Casey Carter
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287249 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-17 19:23:35 +00:00
Shoaib Meenai
e6479bc783 [libc++] Introduce _LIBCPP_OVERRIDABLE_FUNC_VIS
This is a generalization of `_LIBCPP_NEW_DELETE_VIS`; the new macro name
captures the semantics better, and also allows us to get rid of the
`_WIN32` check in `include/new`. No functional change.

Differential Revision: https://reviews.llvm.org/D26702

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287164 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-16 22:18:10 +00:00
Eric Fiselier
3dd27eb62c Fix -verify tests for older ccache versions
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287109 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-16 14:48:42 +00:00
Eric Fiselier
18e2c824b4 Fix non-reserved name usage
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287080 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-16 04:45:32 +00:00
Justin Lebar
efd039a62e [libcxx] Mark xonstexpr-fns.pass.cpp as XFAIL: gcc.
This fails with gcc because __builtin_isnan and friends, which
libcpp_isnan and friends call, are not themselves constexpr-evaluatable.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287041 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-15 22:03:29 +00:00
Eric Fiselier
746d008aeb Add .clang-format to libc++
Adding a Clang Format file to libc++ and which style it should use has been
discussed a couple of times. This patch finally adds a .clang-format file
which specifies LLVM styles.

Personally I dislike how the LLVM style handles much of the meta-programming
in libc++. However the general consensus was that libc++ should prefer the
LLVM style and make adjustments where needed.

Note that using clang-format on changes is not required, especially for
changes within the headers. However formatting tests should be encouraged.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287020 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-15 20:21:30 +00:00
Justin Lebar
bb835ac64d [CUDA] Mark __libcpp_{isnan,isinf,isfinite} as constexpr.
Summary:
This makes these functions available on host and device, which is
necessary to compile <complex> for the device.

Reviewers: hfinkel, EricWF

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D25403

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287012 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-15 19:15:57 +00:00
Vedant Kumar
e3cb222597 Revert "P0503R0, adopted in Issaquah, rewords some requirements on nullptr_t and istream_iterator. No code changes were needed, but I updated a few tests. Also resolved P0509 and P0521, which required no changes to the library or tests."
This reverts commit r286884, because it breaks the Xcode 7 builders:

  http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-expensive/1583

Here is a PR that tracks the issue:
https://llvm.org/bugs/show_bug.cgi?id=31016

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287004 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-15 18:48:36 +00:00
Stephan T. Lavavej
dd8b03ec4c [libcxx] [test] D26627: Fix ordering assumptions in unordered container tests.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@286984 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-15 17:00:38 +00:00