The predicates in CXXRecordDecl which test various properties of special
members can't be called on incomplete decls.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190353
91177308-0d34-0410-b5e6-
96231b3b80d8
DTy = DTy.getNonReferenceType();
CXXRecordDecl *RD = Context->getBaseElementType(DTy)->getAsCXXRecordDecl();
if (RD) {
- if (!RD->hasTrivialDestructor())
+ if (RD->isCompleteDefinition() && !RD->hasTrivialDestructor())
appendDeleteDtor(Block, RD, DE);
}
clang_analyzer_eval(true); // expected-warning{{TRUE}}
}
}
+
+namespace Incomplete {
+ class Foo; // expected-note{{forward declaration}}
+ void f(Foo *foo) { delete foo; } // expected-warning{{deleting pointer to incomplete type}}
+}