[PATCH] D79895: Add a new warning to warn when passing uninitialized variables as const reference parameters to a function

Nikita Kniazev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 23 17:16:42 PDT 2020


nick added a comment.

> We didn't see it in the code bases I work with, so is boost a special case, or an example of a common practice?

I do not have resources to make such statistics, but there are compilers where casting to void is not enough to suppress the warning. https://herbsutter.com/2009/10/18/mailbag-shutting-up-compiler-warnings/#comment-1509 https://godbolt.org/z/pS_iQ3

> If it's just boost, fixing the code seems better

Have you tried to push a fix for a warning in Boost? If it was that simple. A part of my warning-fixing PRs are not merged in years. And considering that fixing this warning will reintroduce warnings for other compilers I probably will have a bad luck with this one too.

> (it will compile faster too).

Should I open a PR with replacing `std::forward` with `static_cast` because it compiles faster? :-)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79895/new/

https://reviews.llvm.org/D79895





More information about the cfe-commits mailing list