diff options
author | John McCall <rjmccall@apple.com> | 2010-05-18 09:35:29 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-05-18 09:35:29 +0000 |
commit | d425d2b78665f42dddda56da31d6a3f576493474 (patch) | |
tree | 90b05f206ba114b3bfa95b5c07a5fa924681bb6a /lib/Sema/SemaCXXCast.cpp | |
parent | 7381d5cfbd599fa2b9e215011ad7cbd449de231a (diff) |
Permit Objective C object pointers to be const_casted.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104019 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaCXXCast.cpp')
-rw-r--r-- | lib/Sema/SemaCXXCast.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Sema/SemaCXXCast.cpp b/lib/Sema/SemaCXXCast.cpp index 1dbdd06eea..c8eae2fb0a 100644 --- a/lib/Sema/SemaCXXCast.cpp +++ b/lib/Sema/SemaCXXCast.cpp @@ -983,7 +983,9 @@ static TryCastResult TryConstCast(Sema &Self, Expr *SrcExpr, QualType DestType, // C++ 5.2.11p5: For a const_cast involving pointers to data members [...] // the rules for const_cast are the same as those used for pointers. - if (!DestType->isPointerType() && !DestType->isMemberPointerType()) { + if (!DestType->isPointerType() && + !DestType->isMemberPointerType() && + !DestType->isObjCObjectPointerType()) { // Cannot cast to non-pointer, non-reference type. Note that, if DestType // was a reference type, we converted it to a pointer above. // The status of rvalue references isn't entirely clear, but it looks like |