summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/tools/clang/include/clang/Sema/ParsedTemplate.h
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm/tools/clang/include/clang/Sema/ParsedTemplate.h')
-rw-r--r--contrib/llvm/tools/clang/include/clang/Sema/ParsedTemplate.h30
1 files changed, 27 insertions, 3 deletions
diff --git a/contrib/llvm/tools/clang/include/clang/Sema/ParsedTemplate.h b/contrib/llvm/tools/clang/include/clang/Sema/ParsedTemplate.h
index da68a49..5aa6f47 100644
--- a/contrib/llvm/tools/clang/include/clang/Sema/ParsedTemplate.h
+++ b/contrib/llvm/tools/clang/include/clang/Sema/ParsedTemplate.h
@@ -32,7 +32,9 @@ namespace clang {
Template
};
- /// \brief Build an empty template argument. This template argument
+ /// \brief Build an empty template argument.
+ ///
+ /// This template argument is invalid.
ParsedTemplateArgument() : Kind(Type), Arg(0) { }
/// \brief Create a template type argument or non-type template argument.
@@ -56,7 +58,7 @@ namespace clang {
SourceLocation TemplateLoc)
: Kind(ParsedTemplateArgument::Template),
Arg(Template.getAsOpaquePtr()),
- Loc(TemplateLoc), SS(SS) { }
+ Loc(TemplateLoc), SS(SS), EllipsisLoc() { }
/// \brief Determine whether the given template argument is invalid.
bool isInvalid() const { return Arg == 0; }
@@ -93,6 +95,21 @@ namespace clang {
return SS;
}
+ /// \brief Retrieve the location of the ellipsis that makes a template
+ /// template argument into a pack expansion.
+ SourceLocation getEllipsisLoc() const {
+ assert(Kind == Template &&
+ "Only template template arguments can have an ellipsis");
+ return EllipsisLoc;
+ }
+
+ /// \brief Retrieve a pack expansion of the given template template
+ /// argument.
+ ///
+ /// \param EllipsisLoc The location of the ellipsis.
+ ParsedTemplateArgument getTemplatePackExpansion(
+ SourceLocation EllipsisLoc) const;
+
private:
KindType Kind;
@@ -107,6 +124,10 @@ namespace clang {
/// \brief The nested-name-specifier that can accompany a template template
/// argument.
CXXScopeSpec SS;
+
+ /// \brief The ellipsis location that can accompany a template template
+ /// argument (turning it into a template template argument expansion).
+ SourceLocation EllipsisLoc;
};
/// \brief Information about a template-id annotation
@@ -161,7 +182,10 @@ namespace clang {
void Destroy() { free(this); }
};
-
+
+ /// Retrieves the range of the given template parameter lists.
+ SourceRange getTemplateParamsRange(TemplateParameterList const *const *Params,
+ unsigned NumParams);
inline const ParsedTemplateArgument &
ASTTemplateArgsPtr::operator[](unsigned Arg) const {
OpenPOWER on IntegriCloud