diff options
Diffstat (limited to 'clang/lib/Sema/SemaTemplateDeduction.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaTemplateDeduction.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/clang/lib/Sema/SemaTemplateDeduction.cpp b/clang/lib/Sema/SemaTemplateDeduction.cpp index b55a232d26c..a75af62bf35 100644 --- a/clang/lib/Sema/SemaTemplateDeduction.cpp +++ b/clang/lib/Sema/SemaTemplateDeduction.cpp @@ -4632,8 +4632,11 @@ bool Sema::DeduceReturnType(FunctionDecl *FD, SourceLocation Loc, // We might need to deduce the return type by instantiating the definition // of the operator() function. - if (CallOp->getReturnType()->isUndeducedType()) - InstantiateFunctionDefinition(Loc, CallOp); + if (CallOp->getReturnType()->isUndeducedType()) { + runWithSufficientStackSpace(Loc, [&] { + InstantiateFunctionDefinition(Loc, CallOp); + }); + } } if (CallOp->isInvalidDecl()) @@ -4654,8 +4657,11 @@ bool Sema::DeduceReturnType(FunctionDecl *FD, SourceLocation Loc, return false; } - if (FD->getTemplateInstantiationPattern()) - InstantiateFunctionDefinition(Loc, FD); + if (FD->getTemplateInstantiationPattern()) { + runWithSufficientStackSpace(Loc, [&] { + InstantiateFunctionDefinition(Loc, FD); + }); + } bool StillUndeduced = FD->getReturnType()->isUndeducedType(); if (StillUndeduced && Diagnose && !FD->isInvalidDecl()) { |

