diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2011-02-20 13:06:31 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2011-02-20 13:06:31 +0000 |
commit | bca07a4524feb4edec581062d631a13116320a24 (patch) | |
tree | a9243275843fbeaa590afc07ee888e006b8d54ea /include/clang/Sema/ParsedTemplate.h | |
parent | 998bc5802ecdd65ce3b270f6c69a8ae8557f0a10 (diff) |
Notes
Diffstat (limited to 'include/clang/Sema/ParsedTemplate.h')
-rw-r--r-- | include/clang/Sema/ParsedTemplate.h | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/include/clang/Sema/ParsedTemplate.h b/include/clang/Sema/ParsedTemplate.h index da68a494bf7b2..5aa6f47425aa2 100644 --- a/include/clang/Sema/ParsedTemplate.h +++ b/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 { |