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 | 0e704f7fcdf3231cf5b6ae7e758b74e47c3a9c05 (patch) | |
| tree | d248aca2285668e7b114ccc4b53285ac59a60c03 /clang/lib/Sema/SemaCXXCast.cpp | |
| parent | 7dfbb1faf169cf3bb407dbbf94c999e02fed3cf0 (diff) | |
| download | bcm5719-llvm-0e704f7fcdf3231cf5b6ae7e758b74e47c3a9c05.tar.gz bcm5719-llvm-0e704f7fcdf3231cf5b6ae7e758b74e47c3a9c05.zip | |
Permit Objective C object pointers to be const_casted.
llvm-svn: 104019
Diffstat (limited to 'clang/lib/Sema/SemaCXXCast.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaCXXCast.cpp | 4 | 
1 files changed, 3 insertions, 1 deletions
| diff --git a/clang/lib/Sema/SemaCXXCast.cpp b/clang/lib/Sema/SemaCXXCast.cpp index 1dbdd06eeab..c8eae2fb0a8 100644 --- a/clang/lib/Sema/SemaCXXCast.cpp +++ b/clang/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 | 

