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