forked from OSchip/llvm-project
[CodeComplete] fix nullptr crash in 612f5ed882
This commit is contained in:
parent
6df05697ca
commit
653b007dc1
|
@ -5519,9 +5519,10 @@ QualType getApproximateType(const Expr *E) {
|
|||
: getApproximateType(CDSME->getBase());
|
||||
if (CDSME->isArrow() && !Base.isNull())
|
||||
Base = Base->getPointeeType(); // could handle unique_ptr etc here?
|
||||
auto *RD = Base.isNull()
|
||||
? nullptr
|
||||
: llvm::dyn_cast<CXXRecordDecl>(getAsRecordDecl(Base));
|
||||
auto *RD =
|
||||
Base.isNull()
|
||||
? nullptr
|
||||
: llvm::dyn_cast_or_null<CXXRecordDecl>(getAsRecordDecl(Base));
|
||||
if (RD && RD->isCompleteDefinition()) {
|
||||
// Look up member heuristically, including in bases.
|
||||
for (const auto *Member : RD->lookupDependentName(
|
||||
|
|
Loading…
Reference in New Issue