diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-07-08 02:38:24 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-07-08 02:38:24 +0000 |
commit | ab91ef1dbe524bba3c0147b11dfdd394153c783d (patch) | |
tree | 8e6d5b141b68afa348ef25365edda4cdf835f5f8 /lib/Sema/SemaExpr.cpp | |
parent | 3a7bd67c06d83b6fdc1cfe8295d28c5dbc5e07ba (diff) |
PR9793: Treat substitution as an instantiation step for the purpose of the
-ftemplate-depth limit. There are various ways to get an infinite (or merely
huge) stack of substitutions with no intervening instantiations. This is also
consistent with gcc's behavior.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159907 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index cfc55e5715..6dbf704765 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -3383,6 +3383,8 @@ ExprResult Sema::BuildCXXDefaultArgExpr(SourceLocation CallLoc, = ArgList.getInnermost(); InstantiatingTemplate Inst(*this, CallLoc, Param, Innermost.first, Innermost.second); + if (Inst) + return ExprError(); ExprResult Result; { |