summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaTemplateInstantiate.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-01-07 00:20:55 +0000
committerDouglas Gregor <dgregor@apple.com>2011-01-07 00:20:55 +0000
commitdd47216cc4460119a7453eea880c6455d2f0fa87 (patch)
treef902b3b3940f5370ad38d7e42c6b34e92b39e100 /clang/lib/Sema/SemaTemplateInstantiate.cpp
parentb13ee84c26a4365ee4f8ea1ae6e56d1f53bbcdd8 (diff)
downloadbcm5719-llvm-dd47216cc4460119a7453eea880c6455d2f0fa87.tar.gz
bcm5719-llvm-dd47216cc4460119a7453eea880c6455d2f0fa87.zip
Factor out the template transformation of a sequence of function
parameters into parameter types, so that substitution of explicitly-specified function template arguments uses the same path. This enables the use of explicitly-specified function template arguments with variadic templates. llvm-svn: 122986
Diffstat (limited to 'clang/lib/Sema/SemaTemplateInstantiate.cpp')
-rw-r--r--clang/lib/Sema/SemaTemplateInstantiate.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaTemplateInstantiate.cpp b/clang/lib/Sema/SemaTemplateInstantiate.cpp
index 7deb7cad3bf..c4f91f9ff67 100644
--- a/clang/lib/Sema/SemaTemplateInstantiate.cpp
+++ b/clang/lib/Sema/SemaTemplateInstantiate.cpp
@@ -1221,6 +1221,23 @@ ParmVarDecl *Sema::SubstParmVarDecl(ParmVarDecl *OldParm,
return NewParm;
}
+/// \brief Substitute the given template arguments into the given set of
+/// parameters, producing the set of parameter types that would be generated
+/// from such a substitution.
+bool Sema::SubstParmTypes(SourceLocation Loc,
+ ParmVarDecl **Params, unsigned NumParams,
+ const MultiLevelTemplateArgumentList &TemplateArgs,
+ llvm::SmallVectorImpl<QualType> &ParamTypes) {
+ assert(!ActiveTemplateInstantiations.empty() &&
+ "Cannot perform an instantiation without some context on the "
+ "instantiation stack");
+
+ TemplateInstantiator Instantiator(*this, TemplateArgs, Loc,
+ DeclarationName());
+ return Instantiator.TransformFunctionTypeParams(Loc, Params, NumParams, 0,
+ ParamTypes, 0);
+}
+
/// \brief Perform substitution on the base class specifiers of the
/// given class template specialization.
///
OpenPOWER on IntegriCloud