diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2009-12-08 19:22:33 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-12-08 19:22:33 +0000 |
commit | 1c548021ec064696f38072fc04035a6c5633a30e (patch) | |
tree | 75d371c56aa98121ac237ebfe5521186611d7e0c /clang/lib | |
parent | c5d082fd5d840abd0bd0b2a3bd99ca1c8c82ccf6 (diff) | |
download | bcm5719-llvm-1c548021ec064696f38072fc04035a6c5633a30e.tar.gz bcm5719-llvm-1c548021ec064696f38072fc04035a6c5633a30e.zip |
Patch to allow cstyle cast of objective-c pointers in objective-c++
mode as they are pervasive.
llvm-svn: 90867
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Sema/SemaCXXCast.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaCXXCast.cpp b/clang/lib/Sema/SemaCXXCast.cpp index 6b4f87ef1df..c11b5fdd75b 100644 --- a/clang/lib/Sema/SemaCXXCast.cpp +++ b/clang/lib/Sema/SemaCXXCast.cpp @@ -1160,6 +1160,10 @@ bool Sema::CXXCheckCStyleCast(SourceRange R, QualType CastTy, Expr *&CastExpr, if (CastTy->isDependentType() || CastExpr->isTypeDependent()) return false; + // allow c-style cast of objective-c pointers as they are pervasive. + if (CastTy->isObjCObjectPointerType()) + return false; + if (!CastTy->isLValueReferenceType() && !CastTy->isRecordType()) DefaultFunctionArrayConversion(CastExpr); |