[clang] [clang][analyzer] Fix the false positive ArgInitializedness warning on unnamed bit-field (PR #145066)

Balazs Benics via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 25 07:57:39 PDT 2025


================
@@ -259,7 +259,7 @@ class FindUninitializedField {
         if (T->getAsStructureType()) {
           if (Find(FR))
             return true;
-        } else {
+        } else if (!I->isUnnamedBitField()){
----------------
steakhal wrote:

I think I'd rather move this check to the beginning of the for loop and just `continue` in this case. That way it's cleaner as it follows an early-return (in this continue) pattern.

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


More information about the cfe-commits mailing list