[PATCH] D71535: [clang][AST] Make 'getPartialSpecializations' const-qualified in DeclTemplate

Twice via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 16 03:16:22 PST 2019


PragmaTwice created this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

I found that `ClassTemplateDecl::getSpecializations` is const-qualified, but `ClassTemplateDecl::getPartialSpecializations`is not, which has very similar implementation to the former method.
So there is a patch to fix it.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D71535

Files:
  clang/include/clang/AST/DeclTemplate.h
  clang/lib/AST/DeclTemplate.cpp


Index: clang/lib/AST/DeclTemplate.cpp
===================================================================
--- clang/lib/AST/DeclTemplate.cpp
+++ clang/lib/AST/DeclTemplate.cpp
@@ -403,7 +403,7 @@
 }
 
 llvm::FoldingSetVector<ClassTemplatePartialSpecializationDecl> &
-ClassTemplateDecl::getPartialSpecializations() {
+ClassTemplateDecl::getPartialSpecializations() const {
   LoadLazySpecializations();
   return getCommonPtr()->PartialSpecializations;
 }
Index: clang/include/clang/AST/DeclTemplate.h
===================================================================
--- clang/include/clang/AST/DeclTemplate.h
+++ clang/include/clang/AST/DeclTemplate.h
@@ -2093,7 +2093,7 @@
   /// Retrieve the set of partial specializations of this class
   /// template.
   llvm::FoldingSetVector<ClassTemplatePartialSpecializationDecl> &
-  getPartialSpecializations();
+  getPartialSpecializations() const;
 
   ClassTemplateDecl(ASTContext &C, DeclContext *DC, SourceLocation L,
                     DeclarationName Name, TemplateParameterList *Params,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71535.234014.patch
Type: text/x-patch
Size: 1045 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20191216/a0aaec57/attachment.bin>


More information about the cfe-commits mailing list