From: John McCall Date: Wed, 21 Apr 2010 02:20:33 +0000 (+0000) Subject: Use const_cast instead of a C cast. Safer, plus it suppresses a gcc warning. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5fae1d67ac199755dd26a102e1bddc881edab19c;p=clang Use const_cast instead of a C cast. Safer, plus it suppresses a gcc warning. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101982 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/ExprObjC.h b/include/clang/AST/ExprObjC.h index dfb842a3d0..14e3d2cd13 100644 --- a/include/clang/AST/ExprObjC.h +++ b/include/clang/AST/ExprObjC.h @@ -706,8 +706,12 @@ public: arg_iterator arg_begin() { return getArgs(); } arg_iterator arg_end() { return getArgs() + NumArgs; } - const_arg_iterator arg_begin() const { return (Stmt **)getArgs(); } - const_arg_iterator arg_end() const { return (Stmt **)getArgs() + NumArgs; } + const_arg_iterator arg_begin() const { + return const_cast(getArgs()); + } + const_arg_iterator arg_end() const { + return const_cast(getArgs()) + NumArgs; + } }; /// ObjCSuperExpr - Represents the "super" expression in Objective-C,