aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaCXXCast.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-05-18 09:35:29 +0000
committerJohn McCall <rjmccall@apple.com>2010-05-18 09:35:29 +0000
commitd425d2b78665f42dddda56da31d6a3f576493474 (patch)
tree90b05f206ba114b3bfa95b5c07a5fa924681bb6a /lib/Sema/SemaCXXCast.cpp
parent7381d5cfbd599fa2b9e215011ad7cbd449de231a (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.cpp4
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