summaryrefslogtreecommitdiff
path: root/libcxx/test/std/utilities/function.objects/func.invoke/invoke_r.pass.cpp
AgeCommit message (Collapse)Author
2023-11-26[libc++][test] Fix unused and nodiscard warnings (#73437)Stephan T. Lavavej
Found while running libc++'s test suite with MSVC's STL. This is structured into a series of commits for easier reviewing; I could also split this into smaller PRs if desired. * Add void-casts for `invoke_r` calls to fix MSVC STL `[[nodiscard]]` warnings. + Our rationale is that if someone is calling `invoke_r<NonVoidType>`, it sure looks like they care about the return value. * Add `[[maybe_unused]]` to silence `-Wunused-parameter` warnings. + This happens because the parameters are used within `LIBCPP_ASSERT`, which vanishes for MSVC's STL. This also motivates the following changes. * Add `[[maybe_unused]]` to fix `-Wunused-variable` warnings. * Always void-cast `debug_comparisons` to fix `-Wunused-variable` warnings. + As this was already unused with a void-cast in one `_LIBCPP_HARDENING_MODE` branch, I'm simply lifting it next to the variable definition. * Add `[[maybe_unused]]` to fix `-Wunused-local-typedef` warnings.
2023-02-13[libc++] Implement P2136R3 std::invoke_rLouis Dionne
Differential Revision: https://reviews.llvm.org/D143610