The following patch restores the "public" access specifier for method
getSpecializations() of FunctionTemplateDecl as well as methods
getSpecializations() and getPartialSpecializations() of ClassTemplateDecl.
They were recently downgraded to "protected", but it seems that clients
such as our application have no other way to query the set of all
specializations of a given template.
Index: include/clang/AST/DeclTemplate.h
===================================================================
--- include/clang/AST/DeclTemplate.h (revision 108841)
+++ include/clang/AST/DeclTemplate.h (working copy)
@@ -522,12 +522,6 @@
/// may implicitly allocate memory for the common pointer.
Common *getCommonPtr();
- /// \brief Retrieve the set of function template specializations of this
- /// function template.
- llvm::FoldingSet<FunctionTemplateSpecializationInfo> &getSpecializations() {
- return getCommonPtr()->Specializations;
- }
-
friend void FunctionDecl::setFunctionTemplateSpecialization(
FunctionTemplateDecl *Template,
const TemplateArgumentList *TemplateArgs,
@@ -549,6 +543,12 @@
return static_cast<FunctionDecl*>(TemplatedDecl);
}
+ /// \brief Retrieve the set of function template specializations of this
+ /// function template.
+ llvm::FoldingSet<FunctionTemplateSpecializationInfo> &getSpecializations() {
+ return getCommonPtr()->Specializations;
+ }
+
/// \brief Return the specialization with the provided arguments if it exists,
/// otherwise return the insertion point.
FunctionDecl *findSpecialization(const TemplateArgument *Args,
@@ -1422,18 +1422,6 @@
/// may implicitly allocate memory for the common pointer.
Common *getCommonPtr();
- /// \brief Retrieve the set of specializations of this class template.
- llvm::FoldingSet<ClassTemplateSpecializationDecl> &getSpecializations() {
- return getCommonPtr()->Specializations;
- }
-
- /// \brief Retrieve the set of partial specializations of this class
- /// template.
- llvm::FoldingSet<ClassTemplatePartialSpecializationDecl> &
- getPartialSpecializations() {
- return getCommonPtr()->PartialSpecializations;
- }
-
ClassTemplateDecl(DeclContext *DC, SourceLocation L, DeclarationName Name,
TemplateParameterList *Params, NamedDecl *Decl)
: TemplateDecl(ClassTemplate, DC, L, Name, Params, Decl),
@@ -1477,6 +1465,11 @@
NamedDecl *Decl,
ClassTemplateDecl *PrevDecl);
+ /// \brief Retrieve the set of specializations of this class template.
+ llvm::FoldingSet<ClassTemplateSpecializationDecl> &getSpecializations() {
+ return getCommonPtr()->Specializations;
+ }
+
/// \brief Return the specialization with the provided arguments if it exists,
/// otherwise return the insertion point.
ClassTemplateSpecializationDecl *
@@ -1489,6 +1482,13 @@
getSpecializations().InsertNode(D, InsertPos);
}
+ /// \brief Retrieve the set of partial specializations of this class
+ /// template.
+ llvm::FoldingSet<ClassTemplatePartialSpecializationDecl> &
+ getPartialSpecializations() {
+ return getCommonPtr()->PartialSpecializations;
+ }
+
/// \brief Return the partial specialization with the provided arguments if it
/// exists, otherwise return the insertion point.
ClassTemplatePartialSpecializationDecl *
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits