From: Mike Stump Date: Mon, 30 Nov 2009 20:10:58 +0000 (+0000) Subject: Add const to accessors that don't modify the object. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6515afe50c8d69dbb029b85f879cb2e083854b6c;p=clang Add const to accessors that don't modify the object. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90153 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/StmtCXX.h b/include/clang/AST/StmtCXX.h index 99cddd82fc..64eea2429c 100644 --- a/include/clang/AST/StmtCXX.h +++ b/include/clang/AST/StmtCXX.h @@ -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; diff --git a/lib/AST/Stmt.cpp b/lib/AST/Stmt.cpp index ff35251ae3..fad80ec0cf 100644 --- a/lib/AST/Stmt.cpp +++ b/lib/AST/Stmt.cpp @@ -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();