Differential Revision: https://reviews.llvm.org/D50673
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@339631
91177308-0d34-0410-b5e6-
96231b3b80d8
continue;
}
- if (T->isPointerType() || T->isReferenceType() || T->isBlockPointerType()) {
+ if (T->isAnyPointerType() || T->isReferenceType() || T->isBlockPointerType()) {
if (isPointerOrReferenceUninit(FR, LocalChain))
ContainsUninitField = true;
continue;
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!");
void noWarningWhenInitialized() {
StructWithBlock a;
}
+
+struct StructWithId {
+ int a;
+ id z; // expected-note{{uninitialized pointer 'this->z'}}
+ StructWithId() : a(0) {} // expected-warning{{1 uninitialized field at the end of the constructor call}}
+};
+
+void warnOnUninitializedId() {
+ StructWithId s;
+}