aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-04-21 02:20:33 +0000
committerJohn McCall <rjmccall@apple.com>2010-04-21 02:20:33 +0000
commit5fae1d67ac199755dd26a102e1bddc881edab19c (patch)
tree8c0a6db2b6940cb4f3037895906535fc1a0d9a03
parent978b935b069e9379e554a2126a525e7b9f458f62 (diff)
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
-rw-r--r--include/clang/AST/ExprObjC.h8
1 files 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<Stmt**>(getArgs());
+ }
+ const_arg_iterator arg_end() const {
+ return const_cast<Stmt**>(getArgs()) + NumArgs;
+ }
};
/// ObjCSuperExpr - Represents the "super" expression in Objective-C,