From: Chris Lattner Date: Sat, 24 Jan 2009 21:08:33 +0000 (+0000) Subject: fix some const-correctness issues. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=caae7b099a0324b7c15dc89a9b70969d5d7ce996;p=clang fix some const-correctness issues. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62931 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/Expr.h b/include/clang/AST/Expr.h index a93f0f467b..19cd5d5786 100644 --- a/include/clang/AST/Expr.h +++ b/include/clang/AST/Expr.h @@ -647,10 +647,14 @@ public: assert(isArgumentType() && "calling getArgumentType() when arg is expr"); return QualType::getFromOpaquePtr(Argument.Ty); } - Expr* getArgumentExpr() const { + Expr *getArgumentExpr() { assert(!isArgumentType() && "calling getArgumentExpr() when arg is type"); return static_cast(Argument.Ex); } + const Expr *getArgumentExpr() const { + return const_cast(this)->getArgumentExpr(); + } + /// Gets the argument type, or the type of the argument expression, whichever /// is appropriate. QualType getTypeOfArgument() const {