Commit Graph

4861 Commits

Author SHA1 Message Date
Marshall Clow
0e5d70781a Deduction guides for the container adaptors - queue, stack, and priority_queue
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@332927 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-22 01:57:53 +00:00
Marshall Clow
32bc2e298c Implement deduction guides for vector
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@332901 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-21 21:30:12 +00:00
Marshall Clow
d4c79d0bbb Deduction guides for list
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@332818 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-20 14:05:31 +00:00
Marshall Clow
fa3202c565 Implement deduction guides for forward_list
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@332811 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-19 16:02:05 +00:00
Marshall Clow
262632877b Remove expression '1L + INT_MAX', because it overflows on machines where int/long are the same size
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@332797 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-19 03:09:05 +00:00
Marshall Clow
69c2095d92 Implement deduction guides for <deque>
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@332785 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-18 23:44:13 +00:00
Marshall Clow
f2c627db20 Disable 'missing-braces' warning
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@332779 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-18 22:21:33 +00:00
Marshall Clow
8a50bbc2b9 Implement deduction guides for <array>; Reviewed as https://reviews.llvm.org/D46964
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@332768 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-18 21:01:04 +00:00
Billy Robert O'Neal III
a811ab8476 [libcxx] [test] Remove unused local typedef in test/std/numerics/rand/rand.eng/rand.eng.lcong/default.pass.cpp
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@332571 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-17 04:59:34 +00:00
Billy Robert O'Neal III
18147ecbe0 Add void casts to suppress nodiscard on linear_congruential_engine.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@332567 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-17 02:58:26 +00:00
Peter Collingbourne
85a7702b4c Condition usage of locale stdlib functions on Android API version
Some *_l functions were not available in some versions of Bionic. This CL
checks that the NDK version supports the functions, and if not, falls back
on the corresponding functions that don't take a locale.

Patch by Tom Anderson!

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@332543 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-16 22:40:12 +00:00
Volodymyr Sapsai
6c03a7a2b3 Emit an error when include <atomic> after <stdatomic.h>
C11 defines `kill_dependency` as a macro in <stdatomic.h>. When you
include <atomic> after <stdatomic.h>, the macro clashes with
`std::kill_dependency` and causes multiple errors. Explicit error should
help in diagnosing those errors.

No change for working code that includes <atomic> before <stdatomic.h>.

rdar://problem/27435938

Reviewers: rsmith, EricWF, mclow.lists, jfb

Reviewed By: jfb

Subscribers: jfb, jkorous-apple, christof, bumblebritches57, JonChesterfield, smeenai, cfe-commits

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



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@332413 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-15 22:38:31 +00:00
Volodymyr Sapsai
44a1ffc37a Update XFAIL so apple-clang-9.0 is the last version not implementing Core 2094.
The test is passing with apple-clang-9.1. rdar://problem/40222003


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@332282 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-14 19:45:24 +00:00
Stephan T. Lavavej
082d5bd7c6 [libcxx] [test] Update msvc_stdlib_force_include.hpp.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@332159 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-11 23:57:32 +00:00
Eric Fiselier
0f328db1aa Fix failing test due to incorrect use of noexcept
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@332066 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-11 00:33:20 +00:00
Eric Fiselier
f307403485 Fix PR37407 - callable traits don't correctly check complete types.
Checking for complete types is really rather tricky when you consider
the amount of specializations required to check a function type. This
specifically caused PR37407 where we incorrectly diagnosed
noexcept function types as incomplete (but there were plenty of other
cases that would cause this).

This patch removes the complete type checking for now. I'm going
to look into adding a clang builtin to correctly do this for us.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@332040 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-10 20:59:35 +00:00
Marshall Clow
faf8db7dfd More notes on Rapperswil issues
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@332000 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-10 17:07:38 +00:00
David Bolvansky
9887da8229 Allow copy elision in path concatenation
Summary:
Just port of libstdc++'s fix to libc++ fs: e6ac4004fe

Author of fix: Jonathan Wakely

Reviewers: EricWF, mclow.lists

Reviewed By: EricWF

Subscribers: smeenai, christof, cfe-commits, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@331910 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-09 18:57:17 +00:00
Volodymyr Sapsai
a382216407 Revert "Emit an error when mixing <stdatomic.h> and <atomic>"
It reverts commit r331379 because turned out `__ALLOW_STDC_ATOMICS_IN_CXX__`
doesn't work well in practice.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@331818 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-08 22:50:35 +00:00
Marshall Clow
5d2e458b6f Status updates for Rapperswil
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@331661 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-07 18:59:04 +00:00
Marshall Clow
6a32b9d38f Update for Rapperswil
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@331638 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-07 14:21:52 +00:00
Stephan T. Lavavej
8663c51b30 [libcxx] [test] Fix whitespace, NFC.
Strip trailing whitespace and untabify.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@331576 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-05 01:40:27 +00:00
Stephan T. Lavavej
fcd4f15ced [libcxx] [test] Fix MSVC x64 truncation warning.
warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data

Requesting post-commit review.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@331575 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-05 01:40:24 +00:00
Volodymyr Sapsai
8fc472d96a Emit an error when mixing <stdatomic.h> and <atomic>
Atomics in C and C++ are incompatible at the moment and mixing the
headers can result in confusing error messages.

Emit an error explicitly telling about the incompatibility. Introduce
the macro `__ALLOW_STDC_ATOMICS_IN_CXX__` that allows to choose in C++
between C atomics and C++ atomics.

rdar://problem/27435938

Reviewers: rsmith, EricWF, mclow.lists

Reviewed By: mclow.lists

Subscribers: jkorous-apple, christof, bumblebritches57, JonChesterfield, smeenai, cfe-commits

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


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@331379 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-02 17:56:45 +00:00
Richard Smith
b110f38082 Fix return type of isinf(double) and isnan(double) where possible.
When using an old version of glibc, a ::isinf(double) and ::isnan(double)
function is provided, rather than just the macro required by C and C++.
Displace this function using _LIBCPP_PREFERRED_OVERLOAD where possible.

The only remaining case where we should get the wrong return type is now
glibc + libc++ + a non-clang compiler.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@331241 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-01 03:05:40 +00:00
Billy Robert O'Neal III
c3ae85dbcf [libcxx] [test] Remove non-portable assertions from filebuf tests
seekoff.pass.cpp:
libc++'s tests are asserting things about the buffer passed to pubsetbuf. [filebuf.virtuals]/12 says that what the filebuf does with the buffer you give it is completely implementation defined. The MSVC++ implementation takes that buffer and hands it off to the CRT (by calling ::setvbuf) and the CRT doesn't necessarily follow the pattern this test wants.
This change simply makes asserts against the buffer's contents use LIBCPP_ASSERT instead of assert.

pbackfail.pass.cpp:
libc++'s tests are asserting about what characters will and will not be available in the putback area. [filebuf.virtuals]/9 says "The function can alter the number of putback positions available as a result of any call." This change LIBCPP_ASSERTS libc++'s behavior, but checks invariants of the putback area independently.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@330999 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-26 22:18:33 +00:00
Marshall Clow
a5996e8dc9 Move old test into test/libcxx, and implement new version of test for ostreambuf_iterator::failed. Fixes PR#37245. Thanks to Billy O'Neill for the bug report.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@330955 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-26 16:16:45 +00:00
Volodymyr Sapsai
db0ba4480a [libcxx] func.wrap.func.con: Unset function before destroying anything
Be defensive against a reentrant std::function::operator=(nullptr_t), in case
the held function object has a non-trivial destructor.  Destroying the function
object in-place can lead to the destructor being called twice.

Patch by Duncan P. N. Exon Smith. C++03 support by Volodymyr Sapsai.

rdar://problem/32836603

Reviewers: EricWF, mclow.lists

Reviewed By: mclow.lists

Subscribers: cfe-commits, arphaman

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


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@330885 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-25 23:38:41 +00:00
Marshall Clow
b911dfd212 Disable the test I just added when testing C++03.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@330838 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-25 16:09:47 +00:00
Marshall Clow
727ed618db Fix static initialization of std::atomic_flag; Fixes PR#37226. Thanks to Ricky Zhou for the report and test case.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@330828 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-25 14:27:29 +00:00
Billy Robert O'Neal III
58bcf28c63 [libcxx] [test] Remove nonportable that errc::is_a_directory produces "Is a directory" from ios_base::failure tests
These io_error asserts that std::errc::is_a_directory has message "Is a directory". On MSVC++ it reports "is a directory" (with a lowercase I). That doesn't matter for the ios_failure component being tested, so just implement in terms of system_category().message().

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@330791 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-25 01:58:55 +00:00
Tim Shen
52cd8e497a Re-commit r330627 "[libcxx] implement <experimental/simd> declarations based on P0214R7."
There are 3 changes:
* Renamed genertor.pass.cpp to generator.pass.cpp
* Removed nothing_to_do.pass.cpp
* Mark GCC 4.9 as UNSUPPORTED for the test files that have negative
  narrowing conversion SFINAE test (see GCC PR63723).

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@330655 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-23 21:54:06 +00:00
Tim Shen
3d3af7d26a Revert "[libcxx] implement <experimental/simd> declarations based on P0214R7."
This reverts commit r330627.

This causes several bots to freak out.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@330636 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-23 19:56:20 +00:00
Tim Shen
ac2a43df0f [libcxx] implement <experimental/simd> declarations based on P0214R7.
Summary:
The patch includes all declarations, and also implements the following features:
* ABI.
* narrowing-conversion related SFIANE, including simd<> ctors and (static_)simd_cast.

Reviewers: mclow.lists, EricWF

Subscribers: lichray, sanjoy, MaskRay, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@330627 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-23 18:47:07 +00:00
Reid Kleckner
efb6d58bf9 Don't do aligned allocations on MSVCRT before 19.12 (update 15.3)
Reviewers: EricWF, pcc

Subscribers: christof, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@330372 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-19 22:12:10 +00:00
Reid Kleckner
7a80814866 Remove impossible _MSC_VER check
Summary:
It is immediately preceded by this check:
  #if _MSC_VER < 1900
  #error "MSVC versions prior to Visual Studio 2015 are not supported"
  #endif

Reviewers: EricWF

Subscribers: christof, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@330360 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-19 19:40:12 +00:00
Saleem Abdulrasool
8dd2afa20a support: add missing locale stubs for android L, M
The strto* family was introduced in android O (API Level 26).  However,
the support headers were adjusted to indicate that all locale aware
functions were added in L.  Provide stubs for the locale aware strto*
family until O.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@330045 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-13 18:14:57 +00:00
Petr Hosek
5558aff7ce [CMake] Set the default ABI version for Fuchsia in CMake as well
This is neeeded since the CMake value is used for the SOVERSION.

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@329983 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-13 01:59:15 +00:00
Stephan T. Lavavej
a9d48f24c5 [libcxx] [test] Use TEST_IGNORE_NODISCARD.
Fixes D45595.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@329979 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-13 00:07:48 +00:00
Stephan T. Lavavej
c538ab0daa [libcxx] [test] Fix whitespace, NFC.
test/std almost always uses spaces; now it is entirely tab-free.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@329978 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-12 23:56:22 +00:00
Stephan T. Lavavej
bf3a3685cf [libcxx] [test] Use TEST_COMPILER_C1XX.
Also TEST_COMPILER_CLANG in one place. (More could be changed.)

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@329977 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-12 23:56:17 +00:00
Stephan T. Lavavej
97fc529b73 [libcxx] [test] Silence MSVC warning C4146.
This test code triggers the MSVC warning:

"unary minus operator applied to unsigned type, result still unsigned"

Although it would be possible to change the test code to avoid
this warning, I have chosen to simply silence it.

Fixes D45594.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@329976 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-12 23:56:14 +00:00
Stephan T. Lavavej
ebb3225ce5 [libcxx] [test] Fix nodiscard warnings.
MSVC's STL has marked to_bytes/from_bytes as nodiscard.

Fixes D45595.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@329975 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-12 23:56:12 +00:00
Stephan T. Lavavej
8a869d0f42 [libcxx] [test] Avoid unary_function.
Replace unary_function inheritance (which was never required,
even in C++98) with argument_type and result_type typedefs.
This increases portability, as unary_function was removed in C++17
and MSVC has implemented that removal.

Fixes D45596.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@329974 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-12 23:56:10 +00:00
Stephan T. Lavavej
f18ee8f765 [libcxx] [test] Avoid MSVC truncation warnings.
MSVC emits "warning C4244: 'initializing': conversion from 'int'
to 'short', possible loss of data" when it sees pair<Whatever, short>
constructed from (whatever, 4), because int is being truncated to
short within pair's constructor. (The compiler doesn't take into
account the fact that 4 is a literal at the callsite; it generates
this warning when the constructor is instantiated, because it might
be called with a runtime-valued int that would actually truncate.)

Instead of static_cast<short>, we can simply change short to int
in these tests, without affecting the pair operations that they're
trying to test: move assignment, convert copy construction, and
convert move construction.

Fixes D45016.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@329973 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-12 23:56:07 +00:00
Petr Hosek
ed744ac69b [libcxx] Set ABI version 2 as default for Fuchsia
This avoids the need for a custom generated config file which is desired
because the custom config files differs per-target which means we cannot
reuse headers across different targets.

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@329770 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-11 01:06:28 +00:00
Billy Robert O'Neal III
28989705f7 [libcxx] [test] Use the correct type from strlen. Include correct header.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@329665 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-10 03:04:07 +00:00
Casey Carter
fcb84f3c11 [test] [NFC] cleanup aligned_storage test
* `s/"" )/"")/g`
* Don't redundantly test triviality for `TEST_STD_VER > 17`

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@329618 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-09 20:41:45 +00:00
Petr Hosek
09ff3dc74f Revert "[CMake] Use custom command and target to install libc++ headers"
This reverts commit r329544 which is failing on libcxx standalone bots.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@329545 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-09 04:36:04 +00:00
Petr Hosek
8d0d6fa4aa [CMake] Use custom command and target to install libc++ headers
Using file(COPY FILE...) has several downsides. Since the file command
is only executed at configuration time, any changes to headers made
after the initial CMake execution are ignored. This can lead to subtle
errors since the just built Clang will be using stale libc++ headers.
Furthermore, since the headers are copied prior to executing the build
system, this may hide missing dependencies on libc++ from other LLVM
components.

This changes replaces the use of file(COPY FILE...) command with a
custom command and target which addresses all aforementioned issues and
matches the implementation already used by other LLVM components that
also install headers like Clang builtin headers.

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@329544 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-09 04:23:04 +00:00