Commit Graph

2907 Commits

Author SHA1 Message Date
Marshall Clow
ff5f9b28ba Add some const_casts in places where we were implicitly casting away constness. No functional change, but now they're explicit
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@305410 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-14 20:00:36 +00:00
Michael Park
eaa74739c0 Mark __is_inplace_* tests as UNSUPPORTED in <= C++14.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@305373 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-14 07:12:55 +00:00
Michael Park
c590dae5d6 Add an __is_inplace_index metafunction.
Summary: This is used to constrain `variant`'s converting constructor correctly.

Reviewers: EricWF, mclow.lists

Reviewed By: EricWF, mclow.lists

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@305370 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-14 05:51:18 +00:00
Marshall Clow
0175dfdfdf Implement the non-parallel versions of reduce and transform_reduce for C++17
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@305365 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-14 04:48:45 +00:00
Marshall Clow
246eb897c9 Fix bug 33389 - __is_transparent check requires too much
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@305292 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-13 14:34:58 +00:00
Marshall Clow
6bb9569124 Add a test with an empty input range - should do nothing
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@305268 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-13 02:28:40 +00:00
Marshall Clow
3128b5abf0 Mark the recent variant test as UNSUPPORTED for C++ before 17
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@305198 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 16:33:41 +00:00
Marshall Clow
bc37f8d93d Make tuple_element static_assert in pair if the index is out of range. Also, add a message to variant_alternative<> in the similar case (it already asserted). Add tests for this
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@305196 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 16:13:17 +00:00
Marshall Clow
568c481c7b [array.tuple]/1 says that instantiating tuple_element<N, array<T, M>> is ill-formed if N >= M. We didn't do that. Add a static_assert to cause a failure, and a test that checks that we failed
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@305191 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 14:41:37 +00:00
Marshall Clow
fb97c4408f Implement the non-parallel versions of exclusive_scan and transform_exclusive_scan. Reviewed as https://reviews.llvm.org/D34038.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@305136 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-10 02:22:13 +00:00
Stephan T. Lavavej
76836caa7d [libcxx] [test] Update locale names for Windows.
locale.codecvt.byname/ctor_char.pass.cpp:
This test used to use "en_US" as a plain string instead of using platform_support.
Need to fix this because MS STL expects "en-US" instead.

platform_support.h:
These are the legacy Windows locale names. Should use IETF tags instead.
I've also added en_US, since a test was using that as a locale string as well.

msvc_stdlib_force_include.hpp:
Remove _MSVC_STL_VER. The libraries will directly define _MSVC_STL_VERSION in the future.

Fixes D29351.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@305000 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-08 18:22:03 +00:00
Stephan T. Lavavej
8ba816b366 [libcxx] [test] Remove a Clang/C2 workaround.
Clang/LLVM doesn't need this workaround.

Fixes D33955.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304999 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-08 18:21:59 +00:00
Eric Fiselier
c597e3867e XFAIL tuple deduction guide test on GCC
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304969 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-08 08:03:35 +00:00
Eric Fiselier
3113ac6f85 Add tests for class template deduction on std::tuple.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304967 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-08 07:18:17 +00:00
Eric Fiselier
276a69c18b Fix compile error with Bionic's PTHREAD_MUTEX_INITIALIZER
On Bionic PTHREAD_MUTEX_INITIALIZER contains the expression "<enum-type> & <integer-type>",
which causes ADL to perform name lookup for operator&. During this lookup Clang decides
that it requires the default member initializer for std::mutex while defining the DMI
for std::mutex::__m_.

If I'm not mistaken this is caused by the explicit noexcept declaration on the defaulted
constructor.

This patch removes the explicit noexcept and instead allows the compiler to declare
the default constructor implicitly noexcept. It also adds a static_assert to ensure
that happens.

Unfortunatly because it's not easy to change the value of _LIBCPP_MUTEX_INITIALIZER
for a single test there is no good way to test this patch.

The Clang behavior causing the trouble here was introduced in r287713, which first
appears in the 4.0 release.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304942 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 20:47:42 +00:00
Michael Park
3762fe69d2 Implement LWG 2904.
Summary:
- Removed the move-constructibe requirement from copy-assignable.
- Updated `__assign_alt` such that we direct initialize if
  `_Tp` can be `nothrow`-constructible from `_Arg`, or `_Tp`'s
  move construction can throw. Otherwise, construct a temporary and move it.
- Updated the tests to remove the pre-LWG2904 path.

Depends on D32671.

Reviewers: EricWF, CaseyCarter

Reviewed By: EricWF

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304891 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 10:22:43 +00:00
Eric Fiselier
7457967300 Fix test with exceptions disabled
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304883 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 09:06:05 +00:00
Casey Carter
3da9072b08 [test] Test changes to accommodate LWG 2904 "Make variant move-assignment more exception safe"
Also: Move constexpr / triviality extension tests into the std tree and make them conditional on _LIBCPP_VERSION / _MSVC_STL_VERSION.

https://reviews.llvm.org/D32671

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304847 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 00:06:04 +00:00
Casey Carter
57a009ae03 add missing constexpr to optional::value_or
[Credit to cpplearner]

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304813 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 18:47:26 +00:00
Stephan T. Lavavej
018fbafdf3 [libcxx] [test] Add _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to msvc_stdlib_force_include.hpp.
This macro will instruct MSVC's STL to not warn about features that are deprecated in C++17,
as libcxx tests those features and uses them elsewhere.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304765 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 02:46:12 +00:00
Casey Carter
91d004da6c [test] Remove workaround for C1XX empty parameter pack bug
Was VSO#109062. This bug was filed *4 years ago*. I submitted a workaround to enable the scoped_allocator_adaptor tests to pass. Bug fixed a week and a half later. This was either a waste of my time, or I've discovered that libc++ has magical bugfix-inducing powers. My money's on the latter.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304730 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-05 19:59:17 +00:00
Marshall Clow
118d2fef02 Fix the recently introduced test to work on C++03
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304629 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-03 01:21:29 +00:00
Marshall Clow
b1d8bca727 Fix some undefined behavior in __hash_table. Thanks to vsk for the report and the patch. Reviewed as https://reviews.llvm.org/D33588.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304617 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-03 00:08:32 +00:00
Vedant Kumar
c689592890 Mark two coroutine tests as unsupported under ubsan, again
This reverts commit r304580, making bool_await_suspend.pass.cpp and
generator.pass.cpp unsupported on ubsan again. The host compiler is
based on r304329, which has the change from PR33271 (r304277). However,
this was not enough to address the issue.

Bot Failure:
http://lab.llvm.org:8011/builders/libcxx-libcxxabi-x86_64-linux-ubuntu-ubsan/builds/628

Unknown type!
UNREACHABLE executed at /home/eric/full-llvm/llvm/lib/IR/ValueTypes.cpp:287!
llvm::EVT::getEVT(llvm::Type*, bool) (/usr/local/bin/clang-5.0+0x17e7a07)
llvm::TargetLoweringBase::getValueType(llvm::DataLayout const&, llvm::Type*, bool) const (/usr/local/bin/clang-5.0+0x852c4a)
llvm::ComputeValueVTs(llvm::TargetLowering const&, llvm::DataLayout const&, llvm::Type*, llvm::SmallVectorImpl<llvm::EVT>&, llvm::SmallVectorImpl<unsigned long>*, unsigned long) (/usr/local/bin/clang-5.0+0x141b6e9)
 llvm::SelectionDAGBuilder::visitTargetIntrinsic(llvm::CallInst const&, unsigned int) (/usr/local/bin/clang-5.0+0x237b1ca)

clang-5.0: /home/eric/full-llvm/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp:1236: virtual void llvm::DwarfDebug::endFunctionImpl(const llvm::MachineFunction *): Assertion `LScopes.getAbstractScopesList().size() == NumAbstractScopes && "ensureAbstractVariableIsCreated inserted abstract scopes"' failed.
__assert_fail_base /build/glibc-9tT8Do/glibc-2.23/assert/assert.c:92:0
(/lib/x86_64-linux-gnu/libc.so.6+0x2dc82)
llvm::DwarfDebug::endFunctionImpl(llvm::MachineFunction const*) (/usr/local/bin/clang-5.0+0x223f86b)
llvm::DebugHandlerBase::endFunction(llvm::MachineFunction const*) (/usr/local/bin/clang-5.0+0x227a5a1)
llvm::AsmPrinter::EmitFunctionBody() (/usr/local/bin/clang-5.0+0x222522f)

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304591 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 20:06:49 +00:00
Vedant Kumar
84d753555f Revert "Mark two coroutine tests as unsupported under ubsan"
This reverts commit r304462, thereby re-enabling two tests under ubsan.
We expect these tests to pass now that PR33271 is fixed.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304580 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 18:30:16 +00:00
Casey Carter
2e612e1621 [test] Allow non-libc++ coroutine_handle::done to strengthen noexcept
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304487 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-01 22:40:16 +00:00
Vedant Kumar
974e519e85 Mark two coroutine tests as unsupported under ubsan
They appear to crash inside of SelectionDAG on some Linux bots, when
ubsan is enabled.

https://bugs.llvm.org/show_bug.cgi?id=33271

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304462 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-01 20:00:40 +00:00
Vedant Kumar
a9d992d310 Remove ubsan XFAILS in two tests
These two tests are ubsan-clean now:
http://lab.llvm.org:8080/green/job/clang-stage2-cmake-RgSan_check/3553/

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304450 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-01 18:48:27 +00:00
Eric Fiselier
01e23b3a4b Fix name used in -verify diagnostic to match trunk
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304384 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-01 02:31:01 +00:00
Eric Fiselier
5ead340ec2 Fix silly mistakes in recent changes made to coroutine test
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304364 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-31 22:20:42 +00:00
Eric Fiselier
018a3d51a4 [Libc++] Use #pragma push_macro/pop_macro to better handle min/max on Windows
Summary:
This patch improves how libc++ handles min/max macros within the headers. Previously libc++ would undef them and emit a warning.
This patch changes libc++ to use `#pragma push_macro`  to save the macro before undefining it, and `#pragma pop_macro` to restore the macros and the end of the header.

Reviewers: mclow.lists, bcraig, compnerd, EricWF

Reviewed By: EricWF

Subscribers: cfe-commits, krytarowski

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304357 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-31 22:07:49 +00:00
Eric Fiselier
256425754d Guard against more macros in tchar.h
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304352 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-31 21:39:54 +00:00
Eric Fiselier
0db8645d28 Transform the libc++ coroutine shell tests into normal .pass.cpp tests.
The shell test versions didn't get all of the flags normal tests
do, specifically warning flags. This patch makes them .pass.cpp tests,
and uses a lit.local.cfg to add -fcoroutines-ts and to make them
UNSUPPORTED when that flag isn't available.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304351 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-31 21:34:43 +00:00
Eric Fiselier
ac633a2a52 Remove uses of _UI because Windows is evil and tchar.h #define's it
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304348 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-31 21:20:18 +00:00
Casey Carter
bed65743b4 [test] s/uexpectedly/unexpectedly/
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304236 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-30 20:12:55 +00:00
Eric Fiselier
53d1985f22 [coroutines] Make coroutine_handle<T>::from_address ill-formed for everything but void*.
from_address requires that the provided pointer refer to the suspended coroutine,
which doesn't have a type, or at least not one knowable by the user. Therefore
every use of `from_address` with a typed pointer is almost certainly a bug.

This behavior is a part of the TS specification, but hopefully it will be
in the future.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304172 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-29 19:24:25 +00:00
Eric Fiselier
704a0db8d3 Fix coroutine test failures caused by API misusages.
More tests to come. I think that from_address overload should be deleted
or ill-formed, except for the 'void*' one; The user cannot possibly
have a typed pointer to the coroutine state.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304131 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-29 06:42:01 +00:00
Eric Fiselier
0a8dab6dc6 Fix multiple bugs in coroutine tests.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304124 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-29 05:00:24 +00:00
Eric Fiselier
120949f3e0 Correct XFAIL's in coroutine tests to only list ubsan
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304106 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-28 20:56:16 +00:00
Eric Fiselier
bcb4a4e5d7 Fix use of uninitialized memory
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304105 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-28 20:49:13 +00:00
Eric Fiselier
5202852ad6 XFAIL tests which trigger coroutine debug info crash in Clang
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304104 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-28 20:49:11 +00:00
Eric Fiselier
75fc44aece Add hack to allow test to run w/o C++17 copy elision
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304103 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-28 20:30:18 +00:00
Eric Fiselier
1e9e38539a Remove XFAIL's for recently fixed bug
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304102 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-28 20:25:41 +00:00
Eric Fiselier
10d9a93ddd [coroutines] Add end-to-end tests within libc++
This patch adds end-to-end/breathing tests for coroutines
into libc++. The tests aren't specifically to test libc++ requirements
but instead are intented to ensure coroutines are working fine in general.

Although libc++ isn't exactly the most correct place for these tests
to live, there is one major advantage. The libc++ test suite is also
used by MSVC and by adding the tests here it ensures they will be
run against all currently available coroutine implementations.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304101 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-28 19:38:21 +00:00
Eric Fiselier
a317745593 Workaround debug info bug in Clangs coroutine implementation
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@303966 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-26 04:09:38 +00:00
Eric Fiselier
4aec787d15 Get <experimental/coroutine> working in C++03.
Clang supports coroutines in all dialects; Therefore libc++ should too,
otherwise the Clang extension is unusable.

I'm not convinced extending support to C++03 is a feasible long term
plan, since as the library grows to offer things like generators it
will be come increasingly difficult to limit the implementation to C++03.

However for the time being supporting C++03 isn't a big deal.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@303963 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-26 03:02:54 +00:00
Eric Fiselier
efcf07d44a Remove incorrect #ifdef guards around variant tests.
The tests were previously guarded by #if defined(_LIBCPP_VER) || defined(_MSVC_STL_VER),
which is both incorrect (e.g. _LIBCPP_VERSION) and unneeded. Although the tests are
technically non-standard (yet) they are supported by both libc++ and MSVC's STL.

libstdc++ doesn't regularly use the test suite so I'm not concerned about guarding these
tests for them.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@303953 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-26 01:27:08 +00:00
Casey Carter
90b8e58ffa [test] Fix breakage from r303947 =(
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@303951 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-26 01:00:56 +00:00
Casey Carter
fd6177ffd6 [test] make_shared<T()>(...) is, uh, libc++-specific
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@303947 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-26 00:37:33 +00:00
Eric Fiselier
1bc177fd5b Update more coroutine_handle signatures to reflect N4663.
Thanks to Casey Carter for pointing out the out-of-date tests and
implementation.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@303900 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-25 19:04:55 +00:00