summaryrefslogtreecommitdiff
path: root/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func
AgeCommit message (Collapse)Author
2025-03-18[libc++] Improve deprecated diagnostic guards.Mark de Wever
Recent Clang-21 builds improved the deprecated diagnotics. This uncovered missing guards in libc++ internally. Note: This patch should be a separate commit and not merged. For testing purposes they are combined. Reviewed as part of #130497.
2024-10-31[libc++] Granularize <cstddef> includes (#108696)Nikolas Klauser
2024-09-16[libc++] Replace `__compressed_pair` with `[[no_unique_address]]` (#76756)Nikolas Klauser
This significantly simplifies the code, improves compile times and improves the object layout of types using `__compressed_pair` in the unstable ABI. The only downside is that this is extremely ABI sensitive and pedantically breaks the ABI for empty final types, since the address of the subobject may change. The ABI of the whole object should not be affected. Fixes #91266 Fixes #93069
2024-05-29[libc++][test] Close LWG3238 and add tests (#93043)Hui
2024-01-09[libc++] Allow running the test suite with optimizations (#68753)Louis Dionne
This patch adds a configuration of the libc++ test suite that enables optimizations when building the tests. It also adds a new CI configuration to exercise this on a regular basis. This is added in the context of [1], which requires building with optimizations in order to hit the bug. [1]: https://github.com/llvm/llvm-project/issues/68552
2023-12-04[libc++] Rename _LIBCPP_INLINE_VISIBILITY to _LIBCPP_HIDE_FROM_ABI (#74095)Louis Dionne
In preparation for running clang-format on the whole code base, we are also removing mentions of the legacy _LIBCPP_INLINE_VISIBILITY macro in favor of the newer _LIBCPP_HIDE_FROM_ABI. We're still leaving the definition of _LIBCPP_INLINE_VISIBILITY to avoid creating needless breakage in case some older patches are checked-in with mentions of the old macro. After we branch for LLVM 18, we can do another pass to clean up remaining uses of the macro that might have gotten introduced by mistake (if any) and remove the macro itself at the same time. This is just a minor convenience to smooth out the transition as much as possible. See https://discourse.llvm.org/t/rfc-clang-formatting-all-of-libc-once-and-for-all for the clang-format proposal.
2023-12-01[libc++][NFC] Update the remaining old license headersNikolas Klauser
2023-09-25[libc++] Remove the CI job testing Clang 15 (#66406)Louis Dionne
Since LLVM 17 has been branched and is on the verge of being released, we can drop the CI job that tests against Clang 15. I think the number of cherry-picks to `release/17.x` will be a lot smaller now, so keeping a Clang 15 job around for that purpose seems unnecessary. As a fly-by, this patch also removes some Clang 15 workarounds and test suite annotations as we usually do. It also removes some slightly older gcc test suite annotations that were missed.
2023-09-25[runtimes] Bump the supported AppleClang version to AppleClang 15 (#67065)Louis Dionne
AppleClang 15 was released on September 18th and is now stable. Per our policy, we're bumping the supported AppleClang compiler to the latest release. This allows cleaning up the test suite, but most importantly unblocking various other patches that are blocked on bumping the compiler requirements.
2023-09-21[runtimes][NFC] Remove old Lit annotations for gcc-12 and clang-14Louis Dionne
We don't support these compilers anymore so these Lit annotations were never used.
2023-07-19[libcxx] Fix copy_move.pass testHaowei Wu
When LLVM is built under MSVC and libcxx ABI is set to 2, the 'copy_move.pass' test will unexpectedly pass. This patch mitigate this issue by setting this test will only expecting FAIL when libcxx ABI version is set to 1. This is a re-land of be9f55f4fff47badcdca17be5bcc0a4a15894739 Differential Revision: https://reviews.llvm.org/D155760 Fixes: https://github.com/llvm/llvm-project/issues/63442
2023-07-19[libc++] Revert "[libcxx] Fix copy_move.pass test"Louis Dionne
This reverts commit be9f55f4fff47badcdca17be5bcc0a4a15894739. The commit was both not approved by the libc++ review group, and also the only change it contained was incorrect.
2023-07-19[libcxx] Fix copy_move.pass testHaowei Wu
When LLVM is built under MSVC and libcxx ABI is set to 2, the 'copy_move.pass' test will unexpectedly pass. This patch mitigate this issue by setting this test will only expecting FAIL when libcxx ABI version is set to 1. Differential Revision: https://reviews.llvm.org/D155760 Fixes: https://github.com/llvm/llvm-project/issues/63442
2023-04-15[libc++] Removes Clang 14 support.Mark de Wever
Per our policy we only support the last two releases. Reviewed By: #libc, EricWF, philnik Differential Revision: https://reviews.llvm.org/D148359
2023-03-17[libc++] Remove unnecessary main() function in .compile.pass.cpp and ↵Louis Dionne
.verify.cpp tests We pretty consistently don't define those cause they are not needed, and it removes the potential pitfall to think that these tests are being run. This doesn't touch .compile.fail.cpp tests since those should be replaced by .verify.cpp tests anyway, and there would be a lot to fix up. As a fly-by, I also fixed a bit of formatting, removed a few unused includes and made some very minor, clearly NFC refactorings such as in allocator.traits/allocator.traits.members/allocate.verify.cpp where the old test basically made no sense the way it was written. Differential Revision: https://reviews.llvm.org/D146236
2023-02-10[libc++] Simplify non_default_allocLouis Dionne
Also, since it is only used in two tests that are C++11/C++14 tests only, I don't think it is worth keeping around in test_allocator.h.
2022-12-15[libc++] Implement P1169R4 (static operator())Nikolas Klauser
Reviewed By: ldionne, huixie90, #libc Spies: EricWF, libcxx-commits, royjacobson Differential Revision: https://reviews.llvm.org/D135016
2022-12-14[libc++] Refactor .compile.fail.cpp tests for std::functionLouis Dionne
Some of those .compile.fail.cpp tests had become incorrect and they were not testing anything. In general, .compile.fail.cpp tests are bad because they make it way too easy to write garbage tests. Indeed, the test could fail to compile due to any reason whatsoever (even a typo) and it would appear to work correctly. Differential Revision: https://reviews.llvm.org/D138731
2022-10-19[libc++] Remove std::function in C++03Nikolas Klauser
We've said that we'll remove `std::function` from C++03 in LLVM 16, so we might as well do it now before we forget. Reviewed By: ldionne, #libc, Mordante Spies: jloser, Mordante, libcxx-commits Differential Revision: https://reviews.llvm.org/D135868
2022-09-18[libc++] Avoid including <tuple> in compressed_pair.hNikolas Klauser
compressed_pair is widely used in the library, but most of the uses don't use the tuple parts. To avoid including <tuple> everywhere, use the forward declaration instead in compressed_pair.h Reviewed By: ldionne, #libc Spies: libcxx-commits Differential Revision: https://reviews.llvm.org/D133331
2022-09-05[libc++] Granularize the rest of memoryNikolas Klauser
Reviewed By: ldionne, #libc Spies: vitalybuka, paulkirth, libcxx-commits, mgorny Differential Revision: https://reviews.llvm.org/D132790
2022-09-02Revert "[libc++] Granularize the rest of memory"Vitaly Buka
Breaks buildbots. This reverts commit 30adaa730c4768b5eb06719c808b2884fcf53cf3.
2022-09-02[libc++] Granularize the rest of memoryNikolas Klauser
Reviewed By: ldionne, #libc Spies: libcxx-commits, mgorny Differential Revision: https://reviews.llvm.org/D132790
2022-08-23[libc++] Extend check for non-ASCII characters to src/, test/ and benchmarks/Louis Dionne
Differential Revision: https://reviews.llvm.org/D132180
2022-06-22[libc++] Remove std::function in C++03Nikolas Klauser
`std::function` has been deprecated for a few releases now. Remove it with an option to opt-back-in with a note that this option will be removed in LLVM 16. Reviewed By: ldionne, #libc Spies: #libc_vendors, EricWF, jloser, libcxx-commits Differential Revision: https://reviews.llvm.org/D127908
2022-05-05[libcxx] [test] Narrow down an XFAIL for clang-cl configurationsMartin Storsjö
This test only fails on x86_64 clang-cl, not for i386. (The root cause is still not explored, thus the FIXME is still relevant.) Differential Revision: https://reviews.llvm.org/D124994
2022-03-17[libc++] Add warning pragma macros in the test suiteNikolas Klauser
Reviewed By: ldionne, #libc, EricWF Spies: EricWF, libcxx-commits Differential Revision: https://reviews.llvm.org/D121552
2022-01-26[libcxx][test] Narrow XFAIL for tests that pass with `msvc && stdlib=msvc`Casey Carter
... but fail with `msvc && stdlib=libc++`. Differential Review: https://reviews.llvm.org/D118194
2022-01-04[libc++] Use std::addressof in std::function::targetLouis Dionne
This guards against hostile overloads of operator&. Thanks to Peter Dimov for the report in https://github.com/boostorg/lambda/issues/24. Differential Revision: https://reviews.llvm.org/D116380
2021-11-16[libc++] Always define a key function for std::bad_function_call in the dylibKonstantin Varlamov
However, whether applications rely on the std::bad_function_call vtable being in the dylib is still controlled by the ABI macro, since changing that would be an ABI break. Also separate preprocessor definitions for whether to use a key function and whether to use a `bad_function_call`-specific `what` message (`what` message is mandated by [LWG2233](http://wg21.link/LWG2233)). Differential Revision: https://reviews.llvm.org/D92397
2021-11-07[libc++] Make test_allocator constexpr-friendly for constexpr string/vectorNikolas Klauser
Make test_allocator etc. constexpr-friendly so they can be used to test constexpr string and possibly constexpr vector Reviewed By: Quuxplusone, #libc, ldionne Differential Revision: https://reviews.llvm.org/D110994
2021-10-29[libcxx] [test] Change LIBCXX-WINDOWS-FIXME into XFAIL: msvc for cases that ↵Martin Storsjö
succeed in mingw configurations Add comments about the reasons for the XFAILs where there was none before. Differential Revision: https://reviews.llvm.org/D112211
2021-08-18[libc++] Remove workarounds for the lack of deduction guides in C++17Louis Dionne
All supported compilers have supported deduction guides in C++17 for a while, so this isn't necessary anymore. Differential Revision: https://reviews.llvm.org/D108213
2021-06-22[libc++] Enable `explicit` conversion operators, even in C++03 mode.Arthur O'Dwyer
C++03 didn't support `explicit` conversion operators; but Clang's C++03 mode does, as an extension, so we can use it. This lets us make the conversion explicit in `std::function` (even in '03), and remove some silly metaprogramming in `std::basic_ios`. Drive-by improvements to the tests for these operators, in addition to making sure all these tests also run in `c++03` mode. Differential Revision: https://reviews.llvm.org/D104682
2021-06-15[libc++] [P0619] Add _LIBCPP_ABI_NO_BINDER_BASES and remove binder typedefs ↵Arthur O'Dwyer
in C++20. Differential Revision: https://reviews.llvm.org/D103753
2021-04-20[libc++] NFC: Normalize `#endif //` comment indentationLouis Dionne
2021-03-22[libcxx] [test] Add XFAIL LIBCXX-WINDOWS-FIXME in 124 tests that fail in the ↵Martin Storsjö
future CI configuration This makes no attempt yet to look into the why/what for each of them, but makes the CI configuration useful for tracking further regressions. After looking into each case, they can either be fixed, or converted into UNSUPPORTED: windows or XFAIL: windows, once the cause is known and explained. A number of the filesystem cases can be fixed by patches that are currently in review. Differential Revision: https://reviews.llvm.org/D99095
2021-03-03[libc++] NFC: Normalize links to bug reportsLouis Dionne
2021-01-25[libc++] Support immovable return types in std::function.Arthur O'Dwyer
LWG reflector consensus is that this was a bug in libc++. (In particular, MSVC also will fix it in their STL, soon.) Bug originally discovered by Logan Smith. Also fix `std::function<const void()>`, which should work the same way as `std::function<void()>` in terms of allowing "conversions" from non-void types. Differential Revision: https://reviews.llvm.org/D94452
2020-12-14[libc++] ADL-proof <functional> by adding _VSTD:: qualification on calls.Arthur O'Dwyer
- std::reference_wrapper - std::function - std::mem_fn While I'm here, remove _VSTD:: qualification from calls to `declval` because it takes no arguments and thus isn't susceptible to ADL. Differential Revision: https://reviews.llvm.org/D92884
2020-10-08[runtimes] Use int main(int, char**) consistently in testsLouis Dionne
This is needed when running the tests in Freestanding mode, where main() isn't treated specially. In Freestanding, main() doesn't get mangled as extern "C", so whatever runtime we're using fails to find the entry point. One way to solve this problem is to define a symbol alias from __Z4mainiPPc to _main, however this requires all definitions of main() to have the same mangling. Hence this commit.
2020-09-29[libc++] Rename the -fno-rtti Lit feature to just no-rttiLouis Dionne
This is consistent to the way we name other Lit features, and it removes the possibility for confusing the Lit feature with the actual compiler flag.
2020-09-21[libc++] Fix failures when running the test suite without RTTILouis Dionne
2020-08-12[libc++] Remove workarounds for missing rvalue referencesLouis Dionne
We don't support GCC in C++03 mode, and Clang provides rvalue references even in C++03 mode. So there's effectively no supported compiler that doesn't support rvalue references. Differential Revision: https://reviews.llvm.org/D84943
2020-06-03[libc++] Remove the c++98 Lit feature from the test suiteLouis Dionne
C++98 and C++03 are effectively aliases as far as Clang is concerned. As such, allowing both std=c++98 and std=c++03 as Lit parameters is just slightly confusing, but provides no value. It's similar to allowing both std=c++17 and std=c++1z, which we don't do. This was discovered because we had an internal bot that ran the test suite under both c++98 AND c++03 -- one of which is redundant. Differential Revision: https://reviews.llvm.org/D80926
2020-05-15Cleanup some test issues:Casey Carter
* improve coverage in `span`'s "conversion from `std::array`" test, while eliminating MSVC diagnostics about `testConstructorArray<T>() && testConstructorArray<const T, T>()` being redundant when `T` is already `const`. * Remove use of `is_assignable` that triggers UB due to an insufficiently-complete type argument in `std::function`'s assignment operator test. * Don't test that `shared_ptr` initialization from an rvalue triggers the lvalue aliasing constructor on non-libc++; this is not the case for Standard Libraries that implement LWG-2996. (Ditto, I'd simply remove this but it's your library ;).) Differential Revision: https://reviews.llvm.org/D80030
2020-05-12[libcxx] Constrain function assignment operator (2574).zoecarver
This patch fixes LWG issue 2574. Differential Review: https://reviews.llvm.org/D62928
2020-04-21[libc++] Fix warnings with Clang in C++03Louis Dionne
2020-04-15[libc++] Remove workaround for .fail.cpp tests that don't have clang-verify ↵Louis Dionne
markup By renaming .fail.cpp tests that don't need clang-verify to .compile.fail.cpp, the new test format will not try to compile these tests with clang-verify, and the old test format will work just the same. However, this allows removing a workaround that requires parsing each test looking for clang-verify markup. After this change, a .fail.cpp test should always have clang-verify markup. When clang-verify is not supported by the compiler, we will just check that these tests fail to compile. When clang-verify is supported, these tests will be compiled with clang-verify whether they have markup or not (so they should have markup, or they will fail). This simplifies the test suite and also ensures that all of our .fail.cpp tests provide clang-verify markup. If it's impossible for a test to have clang-verify markup, it can be moved to a .compile.fail.cpp test, which are unconditionally just checked for compilation failure.
2020-04-07Reset more globalMemCounters.Dan Albert
Reviewers: EricWF, #libc Reviewed By: EricWF, #libc Subscribers: broadwaylamb, libcxx-commits Tags: #libc Differential Revision: https://reviews.llvm.org/D77681