aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/CloneFunction.cpp
diff options
context:
space:
mode:
authorStephan T. Lavavej <stl@nuwen.net>2023-11-26 09:00:18 -0800
committerGitHub <noreply@github.com>2023-11-26 18:00:18 +0100
commit346a29908e0a0401073169ea94c17be72a9c83db (patch)
treef6ca50dc2ab18b8e89827872a79e6fe47be38fcb /llvm/lib/Transforms/Utils/CloneFunction.cpp
parentdc8b055c71d2ff2f43c0f4cac66e15a210b91e3b (diff)
downloadllvm-346a29908e0a0401073169ea94c17be72a9c83db.zip
llvm-346a29908e0a0401073169ea94c17be72a9c83db.tar.gz
llvm-346a29908e0a0401073169ea94c17be72a9c83db.tar.bz2
[libc++][test] Fix unused and nodiscard warnings (#73437)
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.
Diffstat (limited to 'llvm/lib/Transforms/Utils/CloneFunction.cpp')
0 files changed, 0 insertions, 0 deletions