diff options
Diffstat (limited to 'include/clang/AST/TemplateBase.h')
-rw-r--r-- | include/clang/AST/TemplateBase.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/include/clang/AST/TemplateBase.h b/include/clang/AST/TemplateBase.h index b9c2c08943e9..7f289862578d 100644 --- a/include/clang/AST/TemplateBase.h +++ b/include/clang/AST/TemplateBase.h @@ -301,6 +301,10 @@ public: Integer.Type = T.getAsOpaquePtr(); } + /// \brief If this is a non-type template argument, get its type. Otherwise, + /// returns a null QualType. + QualType getNonTypeTemplateArgumentType() const; + /// \brief Retrieve the template argument as an expression. Expr *getAsExpr() const { assert(getKind() == Expression && "Unexpected kind"); @@ -326,8 +330,8 @@ public: /// \brief Iterator range referencing all of the elements of a template /// argument pack. - llvm::iterator_range<pack_iterator> pack_elements() const { - return llvm::make_range(pack_begin(), pack_end()); + ArrayRef<TemplateArgument> pack_elements() const { + return llvm::makeArrayRef(pack_begin(), pack_end()); } /// \brief The number of template arguments in the given template argument @@ -592,6 +596,10 @@ public: return getTrailingObjects<TemplateArgumentLoc>(); } + llvm::ArrayRef<TemplateArgumentLoc> arguments() const { + return llvm::makeArrayRef(getTemplateArgs(), NumTemplateArgs); + } + const TemplateArgumentLoc &operator[](unsigned I) const { return getTemplateArgs()[I]; } @@ -607,7 +615,7 @@ public: /// as such, doesn't contain the array of TemplateArgumentLoc itself, /// but expects the containing object to also provide storage for /// that. -struct LLVM_ALIGNAS(LLVM_PTR_SIZE) ASTTemplateKWAndArgsInfo { +struct alignas(void *) ASTTemplateKWAndArgsInfo { /// \brief The source location of the left angle bracket ('<'). SourceLocation LAngleLoc; |