Tedlion updated this revision to Diff 505802. Tedlion edited the summary of this revision. Tedlion added a comment.
Provide the full diff context instead. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146194/new/ https://reviews.llvm.org/D146194 Files: clang/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp Index: clang/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp @@ -262,7 +262,9 @@ if (T->getAsStructureType()) { if (Find(FR)) return true; - } else { + } else if (!I->isUnnamedBitfield()){ + // unnamed bitfields are skipped during aggregate initialization + // Since they are not supposed to be used, warnings should not be reported const SVal &V = StoreMgr.getBinding(store, loc::MemRegionVal(FR)); if (V.isUndef()) return true;
Index: clang/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp @@ -262,7 +262,9 @@ if (T->getAsStructureType()) { if (Find(FR)) return true; - } else { + } else if (!I->isUnnamedBitfield()){ + // unnamed bitfields are skipped during aggregate initialization + // Since they are not supposed to be used, warnings should not be reported const SVal &V = StoreMgr.getBinding(store, loc::MemRegionVal(FR)); if (V.isUndef()) return true;
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits