summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-07-08 02:38:24 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-07-08 02:38:24 +0000
commit8a874c93d9c1728ca923ecc1ff09da6b6d78c0aa (patch)
tree9bbec5def2bc86bac80310b13a52a9c04b90942e /clang/lib/Sema/SemaExpr.cpp
parent17a2ff2494dc140e47b40b05995a654b6989513b (diff)
downloadbcm5719-llvm-8a874c93d9c1728ca923ecc1ff09da6b6d78c0aa.tar.gz
bcm5719-llvm-8a874c93d9c1728ca923ecc1ff09da6b6d78c0aa.zip
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. llvm-svn: 159907
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index cfc55e5715c..6dbf7047658 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/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;
{
OpenPOWER on IntegriCloud