@@ -1653,43 +1653,25 @@ namespace {
1653
1653
1654
1654
ExprResult RebuildLambdaExpr (SourceLocation StartLoc, SourceLocation EndLoc,
1655
1655
LambdaScopeInfo *LSI) {
1656
- #if 1
1657
1656
CXXMethodDecl *MD = LSI->CallOperator ;
1658
- // if (MD->getParentFunctionOrMethod()) {
1659
- if (true ) {
1660
- #if 0
1661
- NamedDecl *Pattern = MD;
1662
- std::optional<ArrayRef<TemplateArgument>> Innermost;
1663
- if (FunctionTemplateDecl *FTD = MD->getDescribedFunctionTemplate()) {
1664
- Pattern = FTD;
1665
- Innermost = FTD->getInjectedTemplateArgs();
1666
- }
1667
- MultiLevelTemplateArgumentList MLTAL =
1668
- SemaRef.getTemplateInstantiationArgs(Pattern, Pattern->getLexicalDeclContext(),
1669
- /*Final=*/false, Innermost,
1670
- /*RelativeToPrimary=*/true);
1671
- #endif
1672
- ;
1673
- for (ParmVarDecl *PVD : MD->parameters ()) {
1674
- assert (PVD && " null in a parameter list" );
1675
- if (!PVD->hasDefaultArg ())
1676
- continue ;
1677
- Expr *UninstExpr = PVD->getUninstantiatedDefaultArg ();
1678
- // FIXME: Obtain the source location for the '=' token.
1679
- SourceLocation EqualLoc = UninstExpr->getBeginLoc ();
1680
- if (SemaRef.SubstDefaultArgument (EqualLoc, PVD, TemplateArgs)) {
1681
- // If substitution fails, the default argument is set to a
1682
- // RecoveryExpr that wraps the uninstantiated default argument so
1683
- // that downstream diagnostics are omitted.
1684
- ExprResult ErrorResult = SemaRef.CreateRecoveryExpr (
1685
- UninstExpr->getBeginLoc (), UninstExpr->getEndLoc (),
1686
- {UninstExpr}, UninstExpr->getType ());
1687
- if (ErrorResult.isUsable ())
1688
- PVD->setDefaultArg (ErrorResult.get ());
1689
- }
1657
+ for (ParmVarDecl *PVD : MD->parameters ()) {
1658
+ assert (PVD && " null in a parameter list" );
1659
+ if (!PVD->hasDefaultArg ())
1660
+ continue ;
1661
+ Expr *UninstExpr = PVD->getUninstantiatedDefaultArg ();
1662
+ // FIXME: Obtain the source location for the '=' token.
1663
+ SourceLocation EqualLoc = UninstExpr->getBeginLoc ();
1664
+ if (SemaRef.SubstDefaultArgument (EqualLoc, PVD, TemplateArgs)) {
1665
+ // If substitution fails, the default argument is set to a
1666
+ // RecoveryExpr that wraps the uninstantiated default argument so
1667
+ // that downstream diagnostics are omitted.
1668
+ ExprResult ErrorResult = SemaRef.CreateRecoveryExpr (
1669
+ UninstExpr->getBeginLoc (), UninstExpr->getEndLoc (), {UninstExpr},
1670
+ UninstExpr->getType ());
1671
+ if (ErrorResult.isUsable ())
1672
+ PVD->setDefaultArg (ErrorResult.get ());
1690
1673
}
1691
1674
}
1692
- #endif
1693
1675
return inherited::RebuildLambdaExpr (StartLoc, EndLoc, LSI);
1694
1676
}
1695
1677
0 commit comments