diff options
author | Alp Toker <alp@nuanti.com> | 2013-10-08 08:09:04 +0000 |
---|---|---|
committer | Alp Toker <alp@nuanti.com> | 2013-10-08 08:09:04 +0000 |
commit | d69f37b5822420e3c3a1b2e875b122aca8248533 (patch) | |
tree | 32a0e99c2da6c4cc2e7e7278c4325c85365a82bd /lib/Sema/SemaTemplateDeduction.cpp | |
parent | 19ccb1227f5dc338d4b2d9dbbaeaa973c293f8d0 (diff) |
Make InstantiatingTemplate depth checks clearer
The bool conversion operator on InstantiatingTemplate never added value and
only served to obfuscate the template instantiation routines.
This replaces the conversion and its callers with an explicit isInvalid()
function to make it clear what's going on at a glance.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192177 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplateDeduction.cpp')
-rw-r--r-- | lib/Sema/SemaTemplateDeduction.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Sema/SemaTemplateDeduction.cpp b/lib/Sema/SemaTemplateDeduction.cpp index 4a2f939e2a..8c239afc03 100644 --- a/lib/Sema/SemaTemplateDeduction.cpp +++ b/lib/Sema/SemaTemplateDeduction.cpp @@ -2276,7 +2276,7 @@ Sema::DeduceTemplateArguments(ClassTemplatePartialSpecializationDecl *Partial, SmallVector<TemplateArgument, 4> DeducedArgs(Deduced.begin(), Deduced.end()); InstantiatingTemplate Inst(*this, Partial->getLocation(), Partial, DeducedArgs, Info); - if (Inst) + if (Inst.isInvalid()) return TDK_InstantiationDepth; if (Trap.hasErrorOccurred()) @@ -2440,7 +2440,7 @@ Sema::DeduceTemplateArguments(VarTemplatePartialSpecializationDecl *Partial, SmallVector<TemplateArgument, 4> DeducedArgs(Deduced.begin(), Deduced.end()); InstantiatingTemplate Inst(*this, Partial->getLocation(), Partial, DeducedArgs, Info); - if (Inst) + if (Inst.isInvalid()) return TDK_InstantiationDepth; if (Trap.hasErrorOccurred()) @@ -2528,7 +2528,7 @@ Sema::SubstituteExplicitTemplateArguments( FunctionTemplate, DeducedArgs, ActiveTemplateInstantiation::ExplicitTemplateArgumentSubstitution, Info); - if (Inst) + if (Inst.isInvalid()) return TDK_InstantiationDepth; if (CheckTemplateArgumentList(FunctionTemplate, @@ -2779,7 +2779,7 @@ Sema::FinishTemplateArgumentDeduction(FunctionTemplateDecl *FunctionTemplate, FunctionTemplate, DeducedArgs, ActiveTemplateInstantiation::DeducedTemplateArgumentSubstitution, Info); - if (Inst) + if (Inst.isInvalid()) return TDK_InstantiationDepth; ContextRAII SavedContext(*this, FunctionTemplate->getTemplatedDecl()); |