Skip to content

Commit cd3601a

Browse files
committed
remove cxxdecl check
1 parent 0d48289 commit cd3601a

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

clang/lib/Sema/HeuristicResolver.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -304,18 +304,14 @@ std::vector<const NamedDecl *> HeuristicResolverImpl::resolveMemberExpr(
304304

305305
// check if member expr is in the context of an explicit object method
306306
// If so, it's safe to assume the templated arg is of type of the record
307-
const auto ExplicitMemberHeuristic =
308-
[&](const Expr *Base) -> QualType {
307+
const auto ExplicitMemberHeuristic = [&](const Expr *Base) -> QualType {
309308
if (auto *DeclRef = dyn_cast_if_present<DeclRefExpr>(Base)) {
310309
auto *PrDecl = dyn_cast_if_present<ParmVarDecl>(DeclRef->getDecl());
311310

312311
if (PrDecl && PrDecl->isExplicitObjectParameter()) {
313-
auto CxxRecord = dyn_cast_if_present<CXXRecordDecl>(
314-
PrDecl->getDeclContext()->getParent());
315-
316-
if (CxxRecord) {
317-
return Ctx.getTypeDeclType(dyn_cast<TypeDecl>(CxxRecord));
318-
}
312+
// get the parent, a cxxrecord
313+
return Ctx.getTypeDeclType(
314+
dyn_cast<TypeDecl>(PrDecl->getDeclContext()->getParent()));
319315
}
320316
}
321317

0 commit comments

Comments
 (0)