]> granicus.if.org Git - clang/commitdiff
Add const to accessors that don't modify the object.
authorMike Stump <mrs@apple.com>
Mon, 30 Nov 2009 20:10:58 +0000 (20:10 +0000)
committerMike Stump <mrs@apple.com>
Mon, 30 Nov 2009 20:10:58 +0000 (20:10 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90153 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/StmtCXX.h
lib/AST/Stmt.cpp

index 99cddd82fc80d001518e233382966c6a48e81c73..64eea2429c5d087fbbccac246226fdd6441da8e9 100644 (file)
@@ -43,8 +43,8 @@ public:
 
   SourceLocation getCatchLoc() const { return CatchLoc; }
   VarDecl *getExceptionDecl() const { return ExceptionDecl; }
-  QualType getCaughtType();
-  Stmt *getHandlerBlock() { return HandlerBlock; }
+  QualType getCaughtType() const;
+  Stmt *getHandlerBlock() const { return HandlerBlock; }
 
   static bool classof(const Stmt *T) {
     return T->getStmtClass() == CXXCatchStmtClass;
index ff35251ae39f5fa1bd3554e1c83a53068e442fdf..fad80ec0cf23de5d7a74e6d7731cdf6e6ee6b629 100644 (file)
@@ -559,7 +559,7 @@ Stmt::child_iterator CXXCatchStmt::child_end() {
   return &HandlerBlock + 1;
 }
 
-QualType CXXCatchStmt::getCaughtType() {
+QualType CXXCatchStmt::getCaughtType() const {
   if (ExceptionDecl)
     return ExceptionDecl->getType();
   return QualType();