Index: clang/lib/StaticAnalyzer/Checkers/UninitializedObjectChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/UninitializedObjectChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/UninitializedObjectChecker.cpp @@ -417,7 +417,7 @@ continue; } - if (T->isPointerType() || T->isReferenceType() || T->isBlockPointerType()) { + if (T->isAnyPointerType() || T->isReferenceType() || T->isBlockPointerType()) { if (isPointerOrReferenceUninit(FR, LocalChain)) ContainsUninitField = true; continue; @@ -477,7 +477,7 @@ bool FindUninitializedFields::isPointerOrReferenceUninit( const FieldRegion *FR, FieldChainInfo LocalChain) { - assert((FR->getDecl()->getType()->isPointerType() || + assert((FR->getDecl()->getType()->isAnyPointerType() || FR->getDecl()->getType()->isReferenceType() || FR->getDecl()->getType()->isBlockPointerType()) && "This method only checks pointer/reference objects!"); Index: clang/test/Analysis/objcpp-uninitialized-object.mm =================================================================== --- clang/test/Analysis/objcpp-uninitialized-object.mm +++ clang/test/Analysis/objcpp-uninitialized-object.mm @@ -20,3 +20,13 @@ void noWarningWhenInitialized() { StructWithBlock a; } + +struct StructWithId { + int a; + id z; // expected-note{{uninitialized field 'this->z'}} + StructWithId() : a(0) {} // expected-warning{{1 uninitialized field at the end of the constructor call}} +}; + +void warnOnUninitializedId() { + StructWithId s; +}