summaryrefslogtreecommitdiff
path: root/libcxx/test/std/utilities/function.objects/func.bind_front
AgeCommit message (Collapse)Author
2025-08-05[Clang] Add detailed notes explaining why `is_constructible` evaluates to ↵Corentin Jabot
false (Revert 16d5db7) (#151935) Adds explanation why `is_constructible` evaluates to false. This reapplies as-is e476f968bc8e438a0435d10934f148de570db8eb. This was reverted in 16d5db71b3c38f21aa17783a8758f947dca5883f because of a test failure in libc++. The test failure in libc++ is interesting in that, in the absence of nested diagnostics a bunch of diagnostics are emitted as error instead of notes, which we cannot silence with `-verify-ignore-unexpected`. The fix here is to prevent the diagnostics to be emitted in the first place. However this is clearly not ideal and we should make sure to deploy a better solution in the clang 22 time frame, in the lines of https://discourse.llvm.org/t/rfc-add-a-new-text-diagnostics-format-that-supports-nested-diagnostics/87641/12 Fixes #150601 --------- Co-authored-by: Shamshura Egor <164661612+egorshamshura@users.noreply.github.com>
2025-07-30Revert "[libc++][Clang] Added explanation why is_constructible evaluated to ↵Victor Campos
false. Updated the diagnostics checks in libc++ tests. (#144220)" This reverts commit e476f968bc8e438a0435d10934f148de570db8eb. It has introduced a failure tracked by https://github.com/llvm/llvm-project/issues/150601 One libcxx test fail if libcxx is build with no exceptions and no RTTI: - libcxx/utilities/expected/expected.expected/value.observers.verify.cpp
2025-07-08[libc++][Clang] Added explanation why is_constructible evaluated to false. ↵Shamshura Egor
Updated the diagnostics checks in libc++ tests. (#144220) Added explanation why a is constructible evaluated to false. Also fixed problem with ExtractTypeTraitFromExpression. In case std::is_xxx_v<> with variadic pack it tries to get template argument, but fails in expression Arg.getAsType() due to Arg.getKind() == TemplateArgument::ArgKind::Pack, but not TemplateArgument::ArgKind::Type. Reverts #144127 Fixies https://github.com/llvm/llvm-project/pull/143309#issuecomment-2970012054
2024-04-09[libc++] Implement `bind_back` (#81055)Jakub Mazurkiewicz
Implement `std::bind_back` function from P2387R3 "Pipe support for user-defined range adaptors".
2023-09-28[libc++][NFC] Simplify checks for static assertions in .verify.cpp tests ↵Louis Dionne
(#67559) We don't neeed to handle both spellings anymore since we don't support Clang 15 anymore.
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
2022-10-03[libc++] Suppress -Wctad-maybe-unsupported on types w/o deduction guidesLouis Dionne
There are a handful of standard library types that are intended to support CTAD but don't need any explicit deduction guides to do so. This patch adds a dummy deduction guide to those types to suppress -Wctad-maybe-unsupported (which gets emitted in user code). This is a re-application of the original patch by Eric Fiselier in fcd549a7d828 which had been reverted due to reasons lost at this point. I also added the macro to a few more types. Reviving this patch was prompted by the discussion on https://llvm.org/D133425. Differential Revision: https://reviews.llvm.org/D133535
2022-07-25Rewording "static_assert" diagnosticsMuhammad Usman Shahid
This patch rewords the static assert diagnostic output. Failing a _Static_assert in C should not report that static_assert failed. This changes the wording to be more like GCC and uses "static assertion" when possible instead of hard coding the name. This also changes some instances of 'static_assert' to instead be based on the token in the source code. Differential Revision: https://reviews.llvm.org/D129048
2022-07-21Revert "Rewording the "static_assert" to static assertion"Erich Keane
Looks like we again are going to have problems with libcxx tests that are overly specific in their dependency on clang's diagnostics. This reverts commit 6542cb55a3eb115b1c3592514590a19987ffc498.
2022-07-21Rewording the "static_assert" to static assertionMuhammad Usman Shahid
This patch is basically the rewording of the static assert statement's output(error) on screen after failing. Failing a _Static_assert in C should not report that static_assert failed. It’d probably be better to reword the diagnostic to be more like GCC and say “static assertion” failed in both C and C++. consider a c file having code _Static_assert(0, "oh no!"); In clang the output is like: <source>:1:1: error: static_assert failed: oh no! _Static_assert(0, "oh no!"); ^ ~ 1 error generated. Compiler returned: 1 Thus here the "static_assert" is not much good, it will be better to reword it to the "static assertion failed" to more generic. as the gcc prints as: <source>:1:1: error: static assertion failed: "oh no!" 1 | _Static_assert(0, "oh no!"); | ^~~~~~~~~~~~~~ Compiler returned: 1 The above can also be seen here. This patch is about rewording the static_assert to static assertion. Differential Revision: https://reviews.llvm.org/D129048
2021-08-11[libc++] Add the __bind_back and __compose helpersLouis Dionne
Those are going to be used to implement range adaptors, see D107098 for details. Differential Revision: https://reviews.llvm.org/D107785
2021-08-10[libc++][NFC] Simplify tests for bind_frontLouis Dionne
2021-08-09[libc++] Refactor __perfect_forward, bind_front and not_fnLouis Dionne
This patch fixes the constrains on the __perfect_forward constructor and its call operators, which were incorrect. In particular, it makes sure that we closely follow [func.require], which basically says that we must deliver the bound arguments with the appropriate value category or make the call ill-formed, but not silently fall back to using a different value category. As a fly-by, this patch also: - Adds types __bind_front_t and __not_fn_t to make the result of calling bind_front and not_fn more opaque, and improve diagnostics for users. - Adds a bunch of tests for bind_front and remove some that are now redundant. - Adds some missing _LIBCPP_HIDE_FROM_ABI annotations. Immense thanks to @tcanens for raising awareness about this issue, and providing help with the = delete bits. Differential Revision: https://reviews.llvm.org/D107199
2021-06-22[libc++] NFC: Remove unused c++98 Lit featureLouis Dionne
2021-03-02[libc++] Add bind_front function (P0356R5).zoecarver
Implementes [[ http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0356r5.html | P0356R5 ]]. Adds `bind_front` to `functional`. Reviewed By: ldionne, #libc, Quuxplusone Differential Revision: https://reviews.llvm.org/D60368