[libcxx-commits] [libcxx] [libc++][test] Add `void` cast to a discarded call to `remquo` (PR #213849)
A. Jiang via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Aug 3 23:35:47 PDT 2026
https://github.com/frederick-vs-ja created https://github.com/llvm/llvm-project/pull/213849
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.
>From a0016d4edcf8d9cd56fb3af03af7ad6e64c7d281 Mon Sep 17 00:00:00 2001
From: "A. Jiang" <de34 at live.cn>
Date: Tue, 4 Aug 2026 14:26:33 +0800
Subject: [PATCH] [libc++][test] Add `void` cast to a discarded call to
`remquo`
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.
---
libcxx/test/std/depr/depr.c.headers/math_h.pass.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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);
}
};
More information about the libcxx-commits
mailing list