diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2010-05-12 18:16:59 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2010-05-12 18:16:59 +0000 |
commit | 65267b233b167c9276075376a97147f586d37a69 (patch) | |
tree | c1eafcbbed999a43af49c242593ed315ef060762 /lib/Sema/SemaCXXCast.cpp | |
parent | 9679cafc6368cceed1a5e69d3038d0316401b352 (diff) |
Objective-C++ Sema - Allow static_cast of one objc pointer to
another.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103630 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaCXXCast.cpp')
-rw-r--r-- | lib/Sema/SemaCXXCast.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Sema/SemaCXXCast.cpp b/lib/Sema/SemaCXXCast.cpp index b7b6c3535c..9f8b344562 100644 --- a/lib/Sema/SemaCXXCast.cpp +++ b/lib/Sema/SemaCXXCast.cpp @@ -591,7 +591,11 @@ static TryCastResult TryStaticCast(Sema &Self, Expr *&SrcExpr, } } } - + // Allow arbitray objective-c pointer conversion with static casts. + if (SrcType->isObjCObjectPointerType() && + DestType->isObjCObjectPointerType()) + return TC_Success; + // We tried everything. Everything! Nothing works! :-( return TC_NotApplicable; } |