Commit Graph

4137 Commits

Author SHA1 Message Date
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
59e24fe13c Fix more unreserved names
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304383 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-01 02:29:37 +00:00
Eric Fiselier
bf86c8f4dc Rename unreserved names in tuple
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304382 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-01 02:14:21 +00:00
Eric Fiselier
a16c62a07e Upgrade Clang version used by appveyor
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304377 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-01 01:00:59 +00:00
Eric Fiselier
a99bc1563b Define -DNOMINMAX when running the tests on Windows
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304372 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-31 23:27:25 +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
7b7ac67cfb Fix Libc++ build with MinGW64
Summary: This patch corrects the build errors I encountered when building on MinGW64.

Reviewers: mati865, rnk, compnerd, smeenai, bcraig

Reviewed By: mati865, smeenai

Subscribers: martell, chapuni, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304360 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-31 22:14:05 +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
fecf2a493b Add missing 'requires coroutines' to module map
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304180 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-29 23:17:28 +00:00
Eric Fiselier
8fa39c327d Fix <experimental/coroutine> in C++03
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304173 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-29 19:46:16 +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
c80ef6ed28 Guard <experimental/coroutine> against older Clang versions.
Clang started providing -fcoroutines and defining __cpp_coroutines
way before it implemented the __builtin_coro_foo functions. This
means that simply checking if __cpp_coroutines is not a sufficient
way of detecting the actual feature.

This patch implements _LIBCPP_HAS_NO_COROUTINES which implements
a slightly more complex feature check. Specifically it requires
__cpp_coroutines >= 201703L, which only holds for Clang 5.0 built
after 2017/05/24.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@303956 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-26 01:52:59 +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
b3559ed0d6 Re-add <experimental/coroutine> to the module map.
The original issues were caused because <experimental/coroutine>
didn't correctly #ifdef out enough of the header, which caused incomplete
types to be used.

This patch fixes the `#if defined(__cpp_coroutines)` guard and re-adds
the headers to the module map.

It also uglifies some incorrectly non-reserved names.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@303936 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-25 23:39:29 +00:00
Eric Fiselier
afb54769d4 Correct typo: LIBCXXABI_BUILTINS_LIBRARY -> LIBCXX_BUILTINS_LIBRARY
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@303929 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-25 22:43:42 +00:00
Martell Malone
fa3bd28afb libcxx: fix bootstrapping for mingw-w64
Differential Revision: https://reviews.llvm.org/D33388

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@303928 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-25 22:37:15 +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
Billy Robert O'Neal III
90c1331825 Add asserts that the nullptr is maintained in string erase operations.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@303899 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-25 19:01:14 +00:00
Eric Fiselier
0b958696f5 Update coroutine_handle<P>::promise to reflect N4663.
This patch updates the promise() member to match the current spec.
Specifically it removes the non-const overload and make the return
type of the const overload non-const.

This patch also makes the ASSERT_NOT_NOEXCEPT tests libc++ specific,
since other implementations may be free to strengthen the specification.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@303895 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-25 18:52:34 +00:00
Casey Carter
a42191c839 [test] Remove workaround for C1XX conversion-to-nullptr bug
VSO#391542 "Types can't be convertible to nullptr_t"

Also put internal bug numbers on the workarounds in test_workarounds.h for correlation.

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@303889 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-25 17:42:21 +00:00
Casey Carter
8b55cce1c8 [test] Workaround C1XX bug in uses_allocator_types.hpp
VSO#109062 "Explicit template argument specification with empty template parameter pack expansion does not imply further empty pack expansion"

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@303888 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-25 17:42:17 +00:00