Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/llvm/llvm-project.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-02-06Merging r324153:Hans Wennborg
------------------------------------------------------------------------ r324153 | ericwf | 2018-02-02 23:39:59 +0100 (Fri, 02 Feb 2018) | 6 lines Fix has_unique_object_representation after Clang commit r324134. Clang previously reported an empty union as having a unique object representation. This was incorrect and was fixed in a recent Clang commit. This patch fixes the libc++ tests. ------------------------------------------------------------------------ llvm-svn: 324345
2018-01-17Merging r321963:Hans Wennborg
------------------------------------------------------------------------ r321963 | dim | 2018-01-07 08:45:11 -0800 (Sun, 07 Jan 2018) | 51 lines Add pre-C++11 is_constructible wrappers for 3 arguments Summary: After rL319736 for D28253 (which fixes PR28929), gcc cannot compile `<memory>` anymore in pre-C+11 modes, complaining: ``` In file included from /usr/include/c++/v1/memory:648:0, from test.cpp:1: /usr/include/c++/v1/memory: In static member function 'static std::__1::shared_ptr<_Tp> std::__1::shared_ptr<_Tp>::make_shared(_A0&, _A1&, _A2&)': /usr/include/c++/v1/memory:4365:5: error: wrong number of template arguments (4, should be at least 1) static_assert((is_constructible<_Tp, _A0, _A1, _A2>::value), "Can't construct object in make_shared" ); ^ In file included from /usr/include/c++/v1/memory:649:0, from test.cpp:1: /usr/include/c++/v1/type_traits:3198:29: note: provided for 'template<class _Tp, class _A0, class _A1> struct std::__1::is_constructible' struct _LIBCPP_TEMPLATE_VIS is_constructible ^~~~~~~~~~~~~~~~ In file included from /usr/include/c++/v1/memory:648:0, from test.cpp:1: /usr/include/c++/v1/memory:4365:5: error: template argument 1 is invalid static_assert((is_constructible<_Tp, _A0, _A1, _A2>::value), "Can't construct object in make_shared" ); ^ /usr/include/c++/v1/memory: In static member function 'static std::__1::shared_ptr<_Tp> std::__1::shared_ptr<_Tp>::allocate_shared(const _Alloc&, _A0&, _A1&, _A2&)': /usr/include/c++/v1/memory:4444:5: error: wrong number of template arguments (4, should be at least 1) static_assert((is_constructible<_Tp, _A0, _A1, _A2>::value), "Can't construct object in allocate_shared" ); ^ In file included from /usr/include/c++/v1/memory:649:0, from test.cpp:1: /usr/include/c++/v1/type_traits:3198:29: note: provided for 'template<class _Tp, class _A0, class _A1> struct std::__1::is_constructible' struct _LIBCPP_TEMPLATE_VIS is_constructible ^~~~~~~~~~~~~~~~ In file included from /usr/include/c++/v1/memory:648:0, from test.cpp:1: /usr/include/c++/v1/memory:4444:5: error: template argument 1 is invalid static_assert((is_constructible<_Tp, _A0, _A1, _A2>::value), "Can't construct object in allocate_shared" ); ^ ``` This is also reported in https://bugs.freebsd.org/224946 (FreeBSD is apparently one of the very few projects that regularly builds programs against libc++ with gcc). The reason is that the static assertions are invoking `is_constructible` with three arguments, while gcc does not have the built-in `is_constructible` feature, and the pre-C++11 `is_constructible` wrappers in `<type_traits>` only provide up to two arguments. I have added additional wrappers for three arguments, modified the `is_constructible` entry point to take three arguments instead, and added a simple test to is_constructible.pass.cpp. Reviewers: EricWF, mclow.lists Reviewed By: EricWF Subscribers: krytarowski, cfe-commits, emaste Differential Revision: https://reviews.llvm.org/D41805 ------------------------------------------------------------------------ llvm-svn: 322659
2018-01-03Implement p0258r2: has_unique_object_representationsMarshall Clow
llvm-svn: 321685
2017-12-13[libcxx] [test] Fix line endings, avoid unnecessary non-ASCII.Stephan T. Lavavej
benchmarks/util_smartptr.bench.cpp Change CRLF to LF. test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp Consistently comment "\u20ac" as EURO SIGN, its Unicode name, instead of the actual Unicode character. test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_type.pass.cpp Avoid non-ASCII dash. Fixes D40991. llvm-svn: 320536
2017-12-13[libcxx] [test] Fix MSVC warnings, null pointer deref.Stephan T. Lavavej
test/std/algorithms/alg.modifying.operations/alg.generate/generate_n.pass.cpp Silence MSVC warning C4244. This is expected when passing floating-point values for size. test/std/utilities/template.bitset/bitset.members/to_ullong.pass.cpp test/std/utilities/template.bitset/bitset.members/to_ulong.pass.cpp Avoid MSVC "warning C4293: '<<': shift count negative or too big, undefined behavior". MSVC sees (1ULL << N) and warns - being guarded by const bool canFit is insufficient. A small change to the code avoids the warning without the need for a pragma. Remove a spurious printf() declaration from to_ullong.pass.cpp. Change ULL to UL in to_ulong.pass.cpp. The ULL suffix was probably copy-pasted. test/std/utilities/tuple/tuple.general/ignore.pass.cpp Use LIBCPP_STATIC_ASSERT for consistency with other files. test/support/container_test_types.h Fix a null pointer dereference, found by MSVC /analyze warning C6011 "Dereferencing NULL pointer 'm_expected_args'." Fixes D41030. llvm-svn: 320535
2017-12-12[libcxx] P0604, invoke_result and is_invocableZhihao Yuan
Summary: Introduce a new form of `result_of` without function type encoding. Rename and split `is_callable/is_nothrow_callable` into `is_invocable/is_nothrow_invocable/is_invocable_r/is_nothrow_invocable_r` (and associated types accordingly) Change function type encoding of previous `is_callable/is_nothrow_callable` traits to conventional template type parameter lists. Reviewers: EricWF, mclow.lists, bebuch Reviewed By: EricWF, bebuch Subscribers: lichray, bebuch, cfe-commits Differential Revision: https://reviews.llvm.org/D38831 llvm-svn: 320509
2017-12-07[libcxx] [test] Strip trailing whitespace. NFC.Stephan T. Lavavej
llvm-svn: 319994
2017-12-05Land D28253 which fixes PR28929 (which we mistakenly marked as fixed before)Marshall Clow
llvm-svn: 319736
2017-11-28Fix problems with r'890 when building on machines where sizeof(size_t) != ↵Marshall Clow
sizeof(unsigned long long) and C++03 llvm-svn: 319106
2017-11-27Fix PR#35438 - bitset constructor does not zero unused bitsMarshall Clow
llvm-svn: 319074
2017-11-27Fix failure on C++03 botsMarshall Clow
llvm-svn: 319042
2017-11-27Implement LWG#2948: unique_ptr does not define operator<< for stream outputMarshall Clow
llvm-svn: 319038
2017-11-26More of P0600; marking allocation routines as [[nodiscard]]Marshall Clow
llvm-svn: 318992
2017-11-22[libcxx] Implement std::to_address for C++20Eric Fiselier
Summary: Now implements P0653R2 - Utility to convert to raw pointer. Reviewers: mclow.lists, EricWF Reviewed By: EricWF Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D35470 llvm-svn: 318865
2017-11-22Add another test_macros.h include I missed to tuple.by.type.pass.cppBilly Robert O'Neal III
llvm-svn: 318830
2017-11-22Change (void) casts to TEST_IGNORE_NODISCARD, as requested by Eric. Reviewed ↵Billy Robert O'Neal III
as https://reviews.llvm.org/D40065 llvm-svn: 318804
2017-11-15Tolerate even more [[nodiscard]] in the STL. Reviewed as ↵Billy Robert O'Neal III
https://reviews.llvm.org/D39080 llvm-svn: 318277
2017-11-15Tolerate [[nodiscard]] annotations in the STL. Reviewed as ↵Billy Robert O'Neal III
https://reviews.llvm.org/D39033 llvm-svn: 318276
2017-11-13Implement P0550R2: Transformation Trait remove_cvrefMarshall Clow
llvm-svn: 318011
2017-10-31Add a fail test for aligned_union of an incomplete type. See LWG#2979. NFCMarshall Clow
llvm-svn: 316969
2017-10-14Placate unused variable warnings uncovered by improvements to clang's ↵Benjamin Kramer
-Wunused-variable llvm-svn: 315809
2017-10-10Remove unneeded typename from testRoger Ferrer Ibanez
Differential Revision: https://reviews.llvm.org/D38628 llvm-svn: 315278
2017-10-05Fix accidental assignment inside test assertsEric Fiselier
llvm-svn: 314947
2017-10-04Add C++17 explicit deduction guides to std::pair.Eric Fiselier
This patch adds the newly standardized deduction guides for std::pair, allowing it to work class template deduction. llvm-svn: 314864
2017-09-18Fix two failing -verify tests to tolerate old and new clang versionsEric Fiselier
llvm-svn: 313502
2017-09-17Fix failing -verify tests due to change in Clangs static_assert message.Eric Fiselier
Clang recently changed the way it outputs static assert diagnostics. This patch fixes libc++'s -verify tests so they tolerate both the old and new message format. llvm-svn: 313499
2017-09-15Fix accidental ADL in std::allocator_traits meta-programming.Eric Fiselier
There were a number of cases where __double_underscore functions, for example __has_construct_test, were called without being qualified, causing ADL to occur. This patch qualifies those calls to avoid this problem. Thanks to David L. Jones for point out the issue initially. llvm-svn: 313324
2017-09-11Fix PR34298 - Allow std::function with an incomplete return type.Eric Fiselier
This patch fixes llvm.org/PR34298. Previously libc++ incorrectly evaluated the __invokable trait via the converting constructor `function(Tp)` [with Tp = std::function] whenever the copy constructor or copy assignment operator was required. This patch further constrains that constructor to short circut before evaluating the troublesome SFINAE when `Tp` matches std::function. The original patch is from Alex Lorenz. llvm-svn: 312892
2017-09-11Revert "Fix PR34298 - Allow std::function with an incomplete return type."Eric Fiselier
This reverts commit r312890 because the test case fails to compile for older versions of Clang that reject initializing a const object without a user defined constructor. Since this patch should go into 5.0.1, I want to keep it an atomic change, and will re-commit it with a fixed test case. llvm-svn: 312891
2017-09-11Fix PR34298 - Allow std::function with an incomplete return type.Eric Fiselier
This patch fixes llvm.org/PR34298. Previously libc++ incorrectly evaluated the __invokable trait via the converting constructor `function(Tp)` [with Tp = std::function] whenever the copy constructor or copy assignment operator was required. This patch further constrains that constructor to short circut before evaluating the troublesome SFINAE when `Tp` matches std::function. The original patch is from Alex Lorenz. llvm-svn: 312890
2017-08-31[test] Cleanup nullopt_t testsCasey Carter
* Update specification text from N4387 * Delete not_brace_initializable.fail.cpp: it's redundant with nullopt_t.fail.cpp * is_empty<T> implies is_class<T> * is_literal is deprecated; directly verify that we can create a nullopt_t in a constexpr context Differential Revision: D37024 llvm-svn: 312256
2017-08-25[libcxx] [test] Update for C++17 feature removals.Stephan T. Lavavej
test/std/containers/Emplaceable.h test/std/containers/NotConstructible.h test/support/counting_predicates.hpp Replace unary_function/binary_function inheritance with typedefs. test/std/depr/depr.function.objects/depr.base/binary_function.pass.cpp test/std/depr/depr.function.objects/depr.base/unary_function.pass.cpp test/std/utilities/function.objects/func.require/binary_function.pass.cpp test/std/utilities/function.objects/func.require/unary_function.pass.cpp Mark these tests as requiring 98/03/11/14 because 17 removed unary_function/binary_function. test/std/thread/futures/futures.task/futures.task.members/ctor_func_alloc.pass.cpp test/std/thread/futures/futures.task/futures.task.nonmembers/uses_allocator.pass.cpp Mark these tests as requiring 11/14 because 17 removed packaged_task allocator support. test/std/utilities/function.objects/func.wrap/func.wrap.func/derive_from.pass.cpp This test doesn't need to be skipped in C++17 mode. Only the construction of std::function from an allocator needs to be skipped in C++17 mode. test/std/utilities/function.objects/refwrap/refwrap.access/conversion.pass.cpp test/std/utilities/function.objects/refwrap/refwrap.assign/copy_assign.pass.cpp test/std/utilities/function.objects/refwrap/refwrap.const/copy_ctor.pass.cpp test/std/utilities/function.objects/refwrap/refwrap.const/type_ctor.pass.cpp When testing these reference_wrapper features, unary_function inheritance is totally irrelevant. test/std/utilities/function.objects/refwrap/weak_result.pass.cpp Define and use my_unary_function/my_binary_function to test the weak result type machinery (which is still present in C++17, although deprecated). test/support/msvc_stdlib_force_include.hpp Now we can test C++17 strictly, without enabling removed features. Fixes D36503. llvm-svn: 311705
2017-08-11[libcxx] [test] Rename _Up to U, etc. NFCI.Stephan T. Lavavej
This improves readability and (theoretically) improves portability, as _Ugly names are reserved. This performs additional de-uglification, so all of these tests follow the example of iterator.traits/empty.pass.cpp. llvm-svn: 310761
2017-08-11[libcxx] [test] Rename _Tp to T. NFCI.Stephan T. Lavavej
This improves readability and (theoretically) improves portability, as _Ugly names are reserved. llvm-svn: 310758
2017-08-05[libcxx] [test] Fix URLs in comments and make them HTTPS. NFC.Stephan T. Lavavej
llvm-svn: 310156
2017-07-31Mark LWG 2942 as completeEric Fiselier
llvm-svn: 309528
2017-07-29[libcxx] [test] Change comments to say C++ instead of c++. NFC.Stephan T. Lavavej
This makes them consistent (many comments already used uppercase). The special REQUIRES, UNSUPPORTED, and XFAIL comments are excluded from this change. llvm-svn: 309468
2017-07-29[libcxx] [test] In func.wrap.func.con/alloc_F.pass.cpp, fix REQUIRES ↵Stephan T. Lavavej
whitespace. NFC. llvm-svn: 309466
2017-07-29[libcxx] [test] Make files consistently end with newlines, NFC.Stephan T. Lavavej
llvm-svn: 309465
2017-07-29[libcxx] [test] Untabify, NFC.Stephan T. Lavavej
llvm-svn: 309464
2017-07-28[libcxx] [test] Remove an unused local typedef in ↵Stephan T. Lavavej
enable_shared_from_this.pass.cpp. Trivial change, committed without review. llvm-svn: 309322
2017-07-27Disable the deduction guide test I added in 309296 for the moment, while I ↵Marshall Clow
figure out which compilers don't support deduction guides llvm-svn: 309307
2017-07-27Implement P0739R0: 'Some improvements to class template argument deduction ↵Marshall Clow
integration into the standard library' This is an API change (not ABI change) due to a late change in the c++17 standard llvm-svn: 309296
2017-07-10Fix test failure to to new/delete ellisionsEric Fiselier
llvm-svn: 307510
2017-07-09optional: Implement LWG 2900 and P0602Casey Carter
Differential Revision: https://reviews.llvm.org/D32385 llvm-svn: 307505
2017-06-28Added failing tests for index out of range for tuple_element<pair<T1,T2>> ↵Marshall Clow
and variant_alternative<> llvm-svn: 306580
2017-06-21[libcxx] [test] Fix -Wmismatched-tags in ↵Stephan T. Lavavej
tuple_size_structured_bindings.pass.cpp. Clang and C1XX both complain about mismatched class/struct, but libc++ and MSVC's STL differ on what they use for tuple_element/tuple_size, so there's no way to win here. I'm reverting this part of my previous change. In the future, I'll have to suppress the warning for one compiler or the other. llvm-svn: 305854
2017-06-21[libcxx] [test] Strip trailing whitespace. NFC.Stephan T. Lavavej
llvm-svn: 305848
2017-06-20[libcxx] [test] Add more tests to tuple_size_structured_bindings.pass.cpp ↵Stephan T. Lavavej
and make it friendlier to C1XX. Style/paranoia: 42.1 doesn't have an exact binary representation. Although this doesn't cause failures, it makes me uncomfortable, so I'm changing it to 42.5. C1XX rightly warns about unreferenced variables. Adding tests for their values makes C1XX happy and improves test coverage. C1XX (somewhat obnoxiously) warns about seeing a struct specialized as a class. Although the Standard doesn't care, saying struct consistently is better. (The Standard itself is still inconsistent about whether to depict tuple_element and tuple_size as structs or classes.) Fixes D33953. llvm-svn: 305843
2017-06-19Add a missing SFINAE condition to the `variant`'s converting constructor.Michael Park
Remarks: This function shall not participate in overload resolution unless `is_same_v<decay_t<T>, variant>` is false, unless `decay_t<T>` is neither a specialization of `in_place_type_t` nor a specialization of `in_place_index_t`, unless `is_constructible_v<Tj, T>` is true, and unless the expression `FUN(std::forward<T>(t))` (with `FUN` being the above-mentioned set of imaginary functions) is well formed. Depends on D34111. Reviewers: EricWF, K-ballo Reviewed By: EricWF Subscribers: fhahn Differential Revision: https://reviews.llvm.org/D34112 llvm-svn: 305668