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.
1 parent 340c855 commit 2f15372Copy full SHA for 2f15372
lib/AST/Decl.cpp
@@ -6556,9 +6556,12 @@ Expr *ParamDecl::getTypeCheckedDefaultExpr() const {
6556
}
6557
6558
auto &ctx = getASTContext();
6559
- return evaluateOrDefault(
6560
- ctx.evaluator, DefaultArgumentExprRequest{const_cast<ParamDecl *>(this)},
6561
- new (ctx) ErrorExpr(getSourceRange(), ErrorType::get(ctx)));
+ if (Expr *E = evaluateOrDefault(
+ ctx.evaluator,
+ DefaultArgumentExprRequest{const_cast<ParamDecl *>(this)}, nullptr)) {
6562
+ return E;
6563
+ }
6564
+ return new (ctx) ErrorExpr(getSourceRange(), ErrorType::get(ctx));
6565
6566
6567
void ParamDecl::setDefaultExpr(Expr *E, bool isTypeChecked) {
0 commit comments