Commit Graph

1390 Commits

Author SHA1 Message Date
Casey Carter
8df0521f96 [test] two small cleanups:
* Remove unused type from is_assignable.pass.cpp

* Don't specialize `common_type<::X<float>>` in common_type.pass.cpp, which violates the requirements of [meta.trans.other]/5

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@336618 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-09 23:45:09 +00:00
Marshall Clow
64c10d00c3 Implement LWG 2946, 3075 and 3076. Reviewed as https://reviews.llvm.org/D48616
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@336132 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-02 18:41:15 +00:00
Stephan T. Lavavej
9165f9d181 [libcxx] [test] Strip trailing whitespace. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@334676 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-14 00:12:20 +00:00
Volodymyr Sapsai
c19d47a81b Mark the test using <experimental/memory_resource> to require c++experimental.
When built against the old libc++ version the test was causing linker error

Undefined symbols for architecture x86_64:
  "std::experimental::fundamentals_v1::pmr::new_delete_resource()", referenced from:
      void test_evil<WidgetV0, WidgetV0>() in construct_piecewise_pair_evil.pass.cpp.o
      void test_evil<WidgetV0, WidgetV1>() in construct_piecewise_pair_evil.pass.cpp.o
      void test_evil<WidgetV0, WidgetV2>() in construct_piecewise_pair_evil.pass.cpp.o
      void test_evil<WidgetV0, WidgetV3>() in construct_piecewise_pair_evil.pass.cpp.o
      void test_evil<WidgetV1, WidgetV0>() in construct_piecewise_pair_evil.pass.cpp.o
      void test_evil<WidgetV1, WidgetV1>() in construct_piecewise_pair_evil.pass.cpp.o
      void test_evil<WidgetV1, WidgetV2>() in construct_piecewise_pair_evil.pass.cpp.o
      ...



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@334431 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-11 19:42:27 +00:00
Eric Fiselier
d54a86893f Fix test failures after r334053.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@334056 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-06 00:13:49 +00:00
Eric Fiselier
301518c94e Fix PR37694 - std::vector doesn't correctly move construct allocators.
C++2a[container.requirements.general]p8 states that when move constructing
a container, the allocator is move constructed. Vector previously copy
constructed these allocators. This patch fixes that bug.

Additionally it cleans up some unnecessary allocator conversions
when copy constructing containers. Libc++ uses
__internal_allocator_traits::select_on_copy_construction to select
the correct allocator during copy construction, but it unnecessarily
converted the resulting allocator to the user specified allocator
type and back. After this patch list and forward_list no longer
do that.

Technically we're supposed to be using allocator_traits<allocator_type>::select_on_copy_construction,
but that should seemingly be addressed as a separate patch, if at all.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@334053 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-05 22:32:52 +00:00
JF Bastien
c8846cc964 Filesystem tests: un-confuse write time
Summary:
The filesystem test was confused about access versus write / modification time. The spec says:

  file_time_type last_write_time(const path& p, error_code& ec) noexcept;
  Returns: The time of last data modification of p, determined as if by the value of the POSIX stat structure member st_mtime obtained as if by POSIX stat(). The signature with argument ec returns file_time_type::min() if an error occurs.

The test was looking at st_atime, not st_mtime, when comparing the result from last_write_time. That was probably due to using a pair instead of naming things nicely or using types. I opted to rename things so it's clearer.

This used to cause test bot failures.

<rdar://problem/40648859>

Reviewers: EricWF, mclow.lists, aemerson

Subscribers: christof, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@333723 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-01 04:59:48 +00:00
JF Bastien
e4063adf19 Mark deduction guide tests as failing on apple-clang-9
As discussed here: http://lists.llvm.org/pipermail/cfe-dev/2018-May/058116.html
The tests fail on clang-5, as well as apple-clang-9. Mark them as such.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@333479 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-29 23:28:04 +00:00
Marshall Clow
1e6ac5e8f4 Fix embarrasing typo in uncaught_exceptions. Update tests to really test this. Thanks to Peter Klotz for calling my attention to this.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@333467 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-29 22:25:42 +00:00
Eric Fiselier
40a29e79c2 LWG 2969 "polymorphic_allocator::construct() shouldn't pass resource()"
Patch from Arthur O'Dwyer.

In the TS, `uses_allocator` construction for `pair` tried to use an allocator
type of `memory_resource*`, which is incorrect because `memory_resource*` is
not an allocator type. LWG 2969 fixed it to use `polymorphic_allocator` as the
allocator type instead.

https://wg21.link/lwg2969

(D47090 included this in `<memory_resource>`; at Eric's request, I've split
this out into its own patch applied to the existing
`<experimental/memory_resource>` instead.)

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


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@333384 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-29 00:08:47 +00:00
Marshall Clow
d1e11a1a6f Fix up the final bits of breakage due to clang v5 generating bad implicit template deduction guides - specifically for copy-ctors
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@333381 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-28 19:20:21 +00:00
Marshall Clow
afdadcd893 Mark the template deduction tests as UNSUPPORTED on clang 5, because it deduces the wrong type.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@333376 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-28 15:42:47 +00:00
JF Bastien
adf78877c9 Fix optional<char> test breakage
It seems GCC and clang disagree. Talked to mclow on IRC, disabling for now.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@333317 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-25 21:32:27 +00:00
JF Bastien
3dfc68d12a Fix array deduction guide test breakage
No matching constructor

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@333315 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-25 21:17:43 +00:00
JF Bastien
599bf43e56 Fix optional deduction guide test breakage
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@333308 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-25 20:43:57 +00:00
Marshall Clow
756163dbc1 Add one more test for optional
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@333252 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-25 02:22:54 +00:00
Marshall Clow
2fac2d790f Add deduction guides for optional
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@333251 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-25 02:08:49 +00:00
Marshall Clow
7b98dba18e Implement deduction guides for basic_regex
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@333050 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-23 01:57:02 +00:00
Volodymyr Sapsai
72d5c6fbc9 [libcxx] [test] Mark the test as unsupported by apple-clang-8.1.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@333011 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-22 18:46:16 +00:00
Marshall Clow
356a198276 Missed the tests for the deduction guides for prority_queue
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@332931 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-22 02:19:38 +00:00
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
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
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
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
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
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
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
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
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