[clang] [clang] Combine ConstRefUse with other warnings for uninitialized values (PR #147898)

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 10 11:02:33 PDT 2025


================
@@ -1580,13 +1570,21 @@ class UninitValsDiagReporter : public UninitVariablesHandler {
         // guaranteed to produce them in line/column order, this will provide
         // a stable ordering.
         llvm::sort(*vec, [](const UninitUse &a, const UninitUse &b) {
+          // Move ConstRef uses to the back.
----------------
zygoloid wrote:

Is this the best ordering? If we have a definitely-reached const ref use and a "may be uninitialised on some paths to here" use, it's really unclear to me which one we should report. Maybe reporting both makes sense? What do you think?

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


More information about the cfe-commits mailing list