]> granicus.if.org Git - clang/commitdiff
Clone Sema::SubstType for DeclaratorInfos.
authorJohn McCall <rjmccall@apple.com>
Wed, 21 Oct 2009 00:58:09 +0000 (00:58 +0000)
committerJohn McCall <rjmccall@apple.com>
Wed, 21 Oct 2009 00:58:09 +0000 (00:58 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84724 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/Sema.h
lib/Sema/SemaTemplateInstantiate.cpp

index 4ad3deaadfd080cca99e72e8676637fe0aad8e98..0b55ecd7705cf7011ad00e63d966cb6de2967e47 100644 (file)
@@ -3152,6 +3152,10 @@ public:
 
   void PerformPendingImplicitInstantiations();
 
+  DeclaratorInfo *SubstType(DeclaratorInfo *T,
+                            const MultiLevelTemplateArgumentList &TemplateArgs,
+                            SourceLocation Loc, DeclarationName Entity);
+
   QualType SubstType(QualType T,
                      const MultiLevelTemplateArgumentList &TemplateArgs,
                      SourceLocation Loc, DeclarationName Entity);
index 9b9fc00848bb974b1f1a32e4d8aa5581b2f2e5c7..53d158088c8ed661fc738dcb2055782df3eff760 100644 (file)
@@ -702,6 +702,22 @@ TemplateInstantiator::TransformTemplateTypeParmType(TypeLocBuilder &TLB,
 ///
 /// \returns If the instantiation succeeds, the instantiated
 /// type. Otherwise, produces diagnostics and returns a NULL type.
+DeclaratorInfo *Sema::SubstType(DeclaratorInfo *T,
+                                const MultiLevelTemplateArgumentList &Args,
+                                SourceLocation Loc,
+                                DeclarationName Entity) {
+  assert(!ActiveTemplateInstantiations.empty() &&
+         "Cannot perform an instantiation without some context on the "
+         "instantiation stack");
+  
+  if (!T->getType()->isDependentType())
+    return T;
+
+  TemplateInstantiator Instantiator(*this, Args, Loc, Entity);
+  return Instantiator.TransformType(T);
+}
+
+/// Deprecated form of the above.
 QualType Sema::SubstType(QualType T,
                          const MultiLevelTemplateArgumentList &TemplateArgs,
                          SourceLocation Loc, DeclarationName Entity) {