]> granicus.if.org Git - clang/commitdiff
Add a const version of a method, to be consistent with other methods
authorCraig Silverstein <csilvers2000@yahoo.com>
Tue, 6 Jul 2010 23:51:34 +0000 (23:51 +0000)
committerCraig Silverstein <csilvers2000@yahoo.com>
Tue, 6 Jul 2010 23:51:34 +0000 (23:51 +0000)
of the same type.  I think this was just an oversight before.

Reviewed by chandlerc.  Submitted as an "obvious" fix.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107737 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/DeclTemplate.h

index 10230d222363fda9190fe0643f328b2004160725..16646b00776326b9f1ec9050b1cc267025ea3c21 100644 (file)
@@ -1421,6 +1421,10 @@ public:
 
   virtual ClassTemplateDecl *getCanonicalDecl();
 
+  const ClassTemplateDecl *getCanonicalDecl() const {
+    return const_cast<ClassTemplateDecl*>(this)->getCanonicalDecl();
+  }
+
   /// Create a class template node.
   static ClassTemplateDecl *Create(ASTContext &C, DeclContext *DC,
                                    SourceLocation L,