We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 7a35c47 + 2f15372 commit 850a84aCopy full SHA for 850a84a
lib/AST/Decl.cpp
@@ -6570,9 +6570,12 @@ Expr *ParamDecl::getTypeCheckedDefaultExpr() const {
6570
}
6571
6572
auto &ctx = getASTContext();
6573
- return evaluateOrDefault(
6574
- ctx.evaluator, DefaultArgumentExprRequest{const_cast<ParamDecl *>(this)},
6575
- new (ctx) ErrorExpr(getSourceRange(), ErrorType::get(ctx)));
+ if (Expr *E = evaluateOrDefault(
+ ctx.evaluator,
+ DefaultArgumentExprRequest{const_cast<ParamDecl *>(this)}, nullptr)) {
6576
+ return E;
6577
+ }
6578
+ return new (ctx) ErrorExpr(getSourceRange(), ErrorType::get(ctx));
6579
6580
6581
void ParamDecl::setDefaultExpr(Expr *E, bool isTypeChecked) {
0 commit comments