From 5fae1d67ac199755dd26a102e1bddc881edab19c Mon Sep 17 00:00:00 2001 From: John McCall Date: Wed, 21 Apr 2010 02:20:33 +0000 Subject: [PATCH] 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 --- include/clang/AST/ExprObjC.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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, -- 2.50.1