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

Igor Kudrin via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 10 15:03:49 PDT 2025


================
@@ -27,7 +27,7 @@ int const_use(const int i);
 void f(int a) {
   int i;
   const_ref_use(i);             // expected-warning {{variable 'i' is uninitialized when passed as a const reference argument here}}
-  int j = j + const_ref_use(j); // expected-warning {{variable 'j' is uninitialized when used within its own initialization}} expected-warning {{variable 'j' is uninitialized when passed as a const reference argument here}}
+  int j = j + const_ref_use(j); // expected-warning {{variable 'j' is uninitialized when used within its own initialization}}
----------------
igorkudrin wrote:

Added, PTAL

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


More information about the cfe-commits mailing list