Skip to content

Commit 0d48289

Browse files
committed
code review
1 parent c1cdb39 commit 0d48289

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

clang/lib/Sema/HeuristicResolver.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ std::vector<const NamedDecl *> HeuristicResolverImpl::resolveMemberExpr(
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
307307
const auto ExplicitMemberHeuristic =
308-
[&](const Expr *Base) -> std::optional<QualType> {
308+
[&](const Expr *Base) -> QualType {
309309
if (auto *DeclRef = dyn_cast_if_present<DeclRefExpr>(Base)) {
310310
auto *PrDecl = dyn_cast_if_present<ParmVarDecl>(DeclRef->getDecl());
311311

@@ -319,15 +319,15 @@ std::vector<const NamedDecl *> HeuristicResolverImpl::resolveMemberExpr(
319319
}
320320
}
321321

322-
return std::nullopt;
322+
return {};
323323
};
324324

325325
// Try resolving the member inside the expression's base type.
326326
Expr *Base = ME->isImplicitAccess() ? nullptr : ME->getBase();
327327
QualType BaseType = ME->getBaseType();
328328

329-
if (auto Type = ExplicitMemberHeuristic(Base)) {
330-
BaseType = *Type;
329+
if (auto Type = ExplicitMemberHeuristic(Base); !Type.isNull()) {
330+
BaseType = Type;
331331
}
332332

333333
BaseType = simplifyType(BaseType, Base, ME->isArrow());

0 commit comments

Comments
 (0)