From caae7b099a0324b7c15dc89a9b70969d5d7ce996 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 24 Jan 2009 21:08:33 +0000 Subject: [PATCH] fix some const-correctness issues. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62931 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/AST/Expr.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 { -- 2.40.0