Skip to content

Commit 9d90d16

Browse files
[clangd] Avoid calling resolveTypeOfCallExpr() twice in HeuristicResolver::resolveExprToType()
1 parent 4aba5ed commit 9d90d16

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

clang/lib/Sema/HeuristicResolver.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,12 @@ QualType HeuristicResolverImpl::resolveExprToType(const Expr *E) {
450450
if (const auto *CE = dyn_cast<CallExpr>(E)) {
451451
if (QualType Resolved = resolveTypeOfCallExpr(CE); !Resolved.isNull())
452452
return Resolved;
453+
454+
// Don't proceed to try resolveExprToDecls(), it would just call
455+
// resolveTypeOfCallExpr() again.
456+
return E->getType();
453457
}
458+
454459
// Similarly, unwrapping a unary dereference operation does not work via
455460
// resolveExprToDecls.
456461
if (const auto *UO = dyn_cast<UnaryOperator>(E->IgnoreParenCasts())) {

0 commit comments

Comments
 (0)