[libcxx-commits] [libcxx] [libc++][test] Add `void` cast to a discarded call to `remquo` (PR #213849)
via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Aug 3 23:36:22 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libcxx
Author: A. Jiang (frederick-vs-ja)
<details>
<summary>Changes</summary>
For calls to `remquo`, the return values are generally expected to be used, while it is rare to only use the value written via the pointer parameter. Moreover, some implementors already planned to apply `[[nodiscard]]` to `remquo`, see also https://llvm.org/PR171763. As a result, it is perhaps better to add `void` cast to the discarded call to `remquo` in the test file.
---
Full diff: https://github.com/llvm/llvm-project/pull/213849.diff
1 Files Affected:
- (modified) libcxx/test/std/depr/depr.c.headers/math_h.pass.cpp (+1-1)
``````````diff
diff --git a/libcxx/test/std/depr/depr.c.headers/math_h.pass.cpp b/libcxx/test/std/depr/depr.c.headers/math_h.pass.cpp
index d3f3835122374..cc7cbd2e38c32 100644
--- a/libcxx/test/std/depr/depr.c.headers/math_h.pass.cpp
+++ b/libcxx/test/std/depr/depr.c.headers/math_h.pass.cpp
@@ -862,7 +862,7 @@ struct test_two_args {
(void)::remainder(T(), U());
int ip;
ASSERT_SAME_TYPE(decltype(::remquo(T(), U(), &ip)), PromoteResult);
- ::remquo(T(), U(), &ip);
+ (void)::remquo(T(), U(), &ip);
}
};
``````````
</details>
https://github.com/llvm/llvm-project/pull/213849
More information about the libcxx-commits
mailing list