Fix a crash introduced in r189828.
The predicates in CXXRecordDecl which test various properties of special members can't be called on incomplete decls. llvm-svn: 190353
This commit is contained in:
parent
5ab555532b
commit
093f240a73
|
@ -3133,7 +3133,7 @@ CFGBlock *CFGBuilder::VisitCXXDeleteExpr(CXXDeleteExpr *DE,
|
|||
DTy = DTy.getNonReferenceType();
|
||||
CXXRecordDecl *RD = Context->getBaseElementType(DTy)->getAsCXXRecordDecl();
|
||||
if (RD) {
|
||||
if (!RD->hasTrivialDestructor())
|
||||
if (RD->isCompleteDefinition() && !RD->hasTrivialDestructor())
|
||||
appendDeleteDtor(Block, RD, DE);
|
||||
}
|
||||
|
||||
|
|
|
@ -431,3 +431,8 @@ namespace PseudoDtor {
|
|||
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}}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue