Commit Graph

3584 Commits

Author SHA1 Message Date
Shoaib Meenai
833ad542b5 [libc++] Make __num_get_float hidden
It's an internal function and shouldn't be exported. It's also a source
of discrepancy in the published ABI list; these symbols aren't exported
for me on CentOS 7 or Ubuntu 16.04, leading to spurious check-cxx-abilist
failures.

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@290503 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-24 18:05:32 +00:00
Marshall Clow
99447c8e03 Fix bug #31387 - not checking end iterator when parsing decimal escape. Thanks to Karen for the report.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@290500 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-24 17:21:03 +00:00
Eric Fiselier
ab9ab94102 Enable -Wunreachable-code and fix duplicate warning flags
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@290486 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-24 04:34:33 +00:00
Eric Fiselier
e32aed8014 Fix ASAN test failure
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@290482 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-24 03:27:52 +00:00
Eric Fiselier
3414afa415 Fix -Wsign-compare warnings in re tests that only run on OS X
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@290481 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-24 03:20:53 +00:00
Eric Fiselier
68e3ccbecd Fix sign-compare warnings on ARM platforms caused by wchar_t being unsigned
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@290480 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-24 03:09:00 +00:00
Eric Fiselier
2ab8f62c6f Avoid unused warning in __throw_future_error w/o exceptions enabled
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@290479 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-24 01:56:25 +00:00
Eric Fiselier
f62eee4fe7 Fix warning caused by platforms providing a signed wint_t
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@290477 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-24 01:43:54 +00:00
Eric Fiselier
f47536798d Fix yet another missed -Wunused warning. Hopefully this is the last one
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@290476 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-24 01:29:27 +00:00
Eric Fiselier
10dd69eaf1 Fix unused warning which only triggers in C++11
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@290475 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-24 01:12:28 +00:00
Eric Fiselier
e9784032ce fix warnings only produced by apple-clang
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@290474 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-24 01:07:54 +00:00
Eric Fiselier
9d2fd1f556 Fix missed sign-compare warning
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@290473 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-24 00:44:20 +00:00
Eric Fiselier
0a1cbcf2b7 fix newly failing c++03 tests
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@290472 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-24 00:40:45 +00:00
Eric Fiselier
3678f7d6ee Fix another unused warning
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@290470 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-24 00:28:19 +00:00
Eric Fiselier
50f6579e74 fix sign comparison warnings
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@290469 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-24 00:24:44 +00:00
Eric Fiselier
0e5ebbc77c Fix unused parameters and variables
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@290459 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-23 23:37:52 +00:00
Eric Fiselier
17a98d8a92 Don't use posix_memalign on Windows platforms
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@290448 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-23 20:17:23 +00:00
Eric Fiselier
5ac2f14809 Fix PR31440: Make __sanitizer_annotate_contigious_container always visible. Fix from Jan Beich
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@290447 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-23 20:03:52 +00:00
Eric Fiselier
0de917eac4 Update doc and various cleanup
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@290446 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-23 20:00:13 +00:00
Eric Fiselier
59c5cb0116 Add test that _LIBCPP_VERSION matches __libcpp_version
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@290445 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-23 19:38:43 +00:00
Eric Fiselier
8f7a9c085a Add release update instructions for libc++
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@290444 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-23 19:30:24 +00:00
Eric Fiselier
904a9cb99d Update TestingLibcxx doc to reflect the use_system_cxx_lib flag. Patch from Michael Park
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@290441 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-23 19:09:14 +00:00
Eric Fiselier
20ace04348 Add apple-clang-8 to list of XFAILS for some variant tests. Patch from Michael Park
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@290440 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-23 19:07:54 +00:00
Chris Bieneman
a4b3552a4d [CMake] Fix issue reported on sanitizer bots
This should resolve an issue reported on the commit thread that impacted sanitizer bots.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@290052 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-17 21:28:24 +00:00
Chris Bieneman
801aa91790 [CMake] Put headers relative to clang
When libcxx isn't building with an installed LLVM we copy the libcxx headers into the LLVM build directory so that a clang in that build tree can find the headers relative to itself.

This is only important in situations where you don't have headers installed under /, which is common these days on Darwin.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@289963 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-16 17:30:51 +00:00
Eric Fiselier
1d0d379c40 Fix XFAILS for is_trivially_destructible trait
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@289802 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 11:00:07 +00:00
Eric Fiselier
b7fe139a72 Fix typo
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@289781 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 07:23:44 +00:00
Eric Fiselier
cdc59e576e Add tests for LWG 2796
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@289780 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 07:15:39 +00:00
Eric Fiselier
90314c55d1 Add more test cases for PR31384
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@289778 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 07:05:19 +00:00
Eric Fiselier
1739d3ef0a Add test case for PR31384
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@289774 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 06:38:07 +00:00
Eric Fiselier
9663ee4d4f Revert r289727 due to PR31384
This patch reverts the changes to tuple which fixed construction from
types derived from tuple. It breaks the code mentioned in llvm.org/PR31384.
I'll follow this commit up with a test case.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@289773 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 06:34:54 +00:00
Eric Fiselier
4a435415ad XFAIL test for more apple-clang versions
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@289767 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 05:41:07 +00:00
Eric Fiselier
c480bc55cd Work around bug in initialization of std::array base class with older clangs
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@289741 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-14 23:24:12 +00:00
Eric Fiselier
bad1d6c248 Fix PR31378 - std::list::remove should not require a default constructible allocator.
In list::remove we collect the nodes we're removing in a seperate
list instance. However we construct this list using the default
constructor which default constructs the allocator. However allocators
are not required to be default constructible. This patch fixes the
construction of the second list.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@289735 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-14 22:48:38 +00:00
Stephan T. Lavavej
7b7dedb244 [libcxx] [test] Fix MSVC x64 truncation warnings with 32-bit allocator size_type/difference_type.
test/std/containers/container.adaptors/queue/queue.cons.alloc/ctor_container_alloc.pass.cpp
test/std/containers/container.adaptors/stack/stack.cons.alloc/ctor_container_alloc.pass.cpp
Iterate with C::size_type because that's what operator[] takes.

test/std/containers/sequences/vector/contiguous.pass.cpp
test/std/strings/basic.string/string.require/contiguous.pass.cpp
Add static_cast<typename C::difference_type> because that's what the iterator's operator+ takes.

Fixes D27777.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@289734 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-14 22:46:46 +00:00
Eric Fiselier
18e56b438e [libcxx] Fix tuple construction/assignment from types derived from tuple/pair/array.
Summary:
The standard requires tuple have the following constructors:
```
tuple(tuple<OtherTypes...> const&);
tuple(tuple<OtherTypes...> &&);
tuple(pair<T1, T2> const&);
tuple(pair<T1, T2> &&);
tuple(array<T, N> const&);
tuple(array<T, N> &&);
```
However libc++ implements these as a single constructor with the signature:
```
template <class TupleLike, enable_if_t<__is_tuple_like<TupleLike>::value>>
tuple(TupleLike&&);
```

This causes the constructor to reject types derived from tuple-like types; Unlike if we had all of the concrete overloads, because they cause the derived->base conversion in the signature.

This patch fixes this issue by detecting derived types and the tuple-like base they are derived from. It does this by creating an overloaded function with signatures for each of tuple/pair/array and checking if the possibly derived type can convert to any of them.

This patch fixes [PR17550]( https://llvm.org/bugs/show_bug.cgi?id=17550)

This patch 

Reviewers: mclow.lists, K-ballo, mpark, EricWF

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@289727 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-14 22:22:38 +00:00
Eric Fiselier
a793c18bae XFAIL test on apple-clang-7.0
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@289716 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-14 21:44:08 +00:00
Eric Fiselier
ff62475dcd [libcxx] Fix PR24075, PR23841 - Add scoped_allocator_adaptor::construct(pair<T, U>*, ...) overloads.
Summary:
For more information see:

* https://llvm.org/bugs/show_bug.cgi?id=23841
* https://llvm.org/bugs/show_bug.cgi?id=24075

I hope you have as much fun reviewing as I did writing these insane tests!

Reviewers: mclow.lists, AlisdairM, EricWF

Subscribers: AlisdairM, Potatoswatter, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@289710 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-14 21:29:29 +00:00
Eric Fiselier
6d95982406 Recommit r286884: 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 patch was reverted due to llvm.org/PR31016. There is a bug in Clang 3.7
which causes default.pass.cpp to fails. That test is now marked as XFAIL for that
clang version.

This patch was originally authored by Marshall Clow.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@289708 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-14 21:22:48 +00:00
Stephan T. Lavavej
4d6f42350e [libcxx] [test] Fix size_t-to-int truncation warnings in syserr.hash.
After r289363, these tests were triggering MSVC x64 warning C4267
"conversion from 'size_t' to 'int', possible loss of data" by taking 0, 2, and 10
as std::size_t, then constructing error_code(int, const error_category&) or
error_condition(int, const error_category&) from that (N4618 19.5.3.2
[syserr.errcode.constructors]/3, 19.5.4.2 [syserr.errcondition.constructors]/3).

The fix is simple: take these ints as int, pass them to the int-taking
constructor, and perform a value-preserving static_cast<std::size_t>
when comparing them to `std::size_t result`.

Fixes D27691.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@289512 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-13 01:54:58 +00:00
Stephan T. Lavavej
b988a6fb41 [libcxx] [test] Change ifstream constructor tests to handle read-only files.
Certain source control systems like to set the read-only bit on their files,
which interferes with opening "test.dat" for both input and output.
Fortunately, we can work around this without losing test coverage.
Now, the ifstream.cons tests have comments referring to the ofstream.cons tests.
There, we're creating writable files (not checked into source control),
where the ifstream constructor tests will succeed.

Fixes D26814.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@289463 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-12 19:50:22 +00:00
Stephan T. Lavavej
fbbec294b0 [libcxx] [test] Fix an improper assumption about Null Forward Iterators.
Value-initialized iterators still can't be compared to those with parents.

Fixes D26626.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@289462 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-12 19:50:14 +00:00
Petr Hosek
513447dbb9 [libcxx][CMake] Move the warning to HandleOutOfTreeLLVM
This currently gives a warning when building libcxx under runtimes.

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@289418 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-12 05:05:46 +00:00
Eric Fiselier
d8e3e932bf Actually re-disable -Wsign-compare
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@289367 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-11 05:54:43 +00:00
Eric Fiselier
ab804f1b7d Re-disable -Wsign-compare for now. I didn't catch all occurrences
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@289366 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-11 05:45:55 +00:00
Eric Fiselier
a2cd270943 Enable the -Wsign-compare warning to better support MSVC
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@289363 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-11 05:31:00 +00:00
Eric Fiselier
47dfc5940d Fix copy/paste errors introduced in r289358
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@289359 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-11 04:00:26 +00:00
Eric Fiselier
11f64dcc58 Fix undefined behavior in container swap tests.
These swap tests were swapping non-POCS non-equal allocators which
is undefined behavior. This patch changes the tests to use allocators
which compare equal. In order to test that the allocators were not
swapped I added an "id" field to test_allocator which does not
participate in equality but does propagate across copies/swaps.

This patch is based off of D26623 which was submitted by STL.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@289358 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-11 03:41:12 +00:00
Eric Fiselier
12a450ff3b Fix yet another dynamic exception spec
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@289357 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-11 02:49:37 +00:00
Eric Fiselier
e5bca2ba66 Fix more uses of dynamic exception specifications in C++17
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@289356 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-11 02:47:36 +00:00