Skip to content

Commit 850a84a

Browse files
authored
Merge pull request #38212 from CodaFi/defuse-refuse
2 parents 7a35c47 + 2f15372 commit 850a84a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lib/AST/Decl.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6570,9 +6570,12 @@ Expr *ParamDecl::getTypeCheckedDefaultExpr() const {
65706570
}
65716571

65726572
auto &ctx = getASTContext();
6573-
return evaluateOrDefault(
6574-
ctx.evaluator, DefaultArgumentExprRequest{const_cast<ParamDecl *>(this)},
6575-
new (ctx) ErrorExpr(getSourceRange(), ErrorType::get(ctx)));
6573+
if (Expr *E = evaluateOrDefault(
6574+
ctx.evaluator,
6575+
DefaultArgumentExprRequest{const_cast<ParamDecl *>(this)}, nullptr)) {
6576+
return E;
6577+
}
6578+
return new (ctx) ErrorExpr(getSourceRange(), ErrorType::get(ctx));
65766579
}
65776580

65786581
void ParamDecl::setDefaultExpr(Expr *E, bool isTypeChecked) {

0 commit comments

Comments
 (0)