[llvm] [NFC][CodingStandard] Deprecate use of void casts to suppress warnings (PR #142850)

Rahul Joshi via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 4 15:32:13 PDT 2025


jurahul wrote:

I see your point. If due to a bug it became unused in the #else path the prior code would still warn, the new one would not. I'll let the reviewers decide if this loss of precision is fine. If we *really* need to preserve this precision while still using `maybe_unused` it seems we could need to do something like:

```
void f(int x) {
#ifdef XYZ
  [[maybe_unused]] int dummy = x;
#else
  // use x;
#endif
}      


https://github.com/llvm/llvm-project/pull/142850


More information about the llvm-commits mailing list