diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2014-05-30 16:35:53 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2014-05-30 16:35:53 +0000 |
commit | f6da0fd888382d274bbb0bfceab4724c701b4922 (patch) | |
tree | 17919d76cae6dcda7f6c5484cf5b91f9ed9b464d /lib/Sema/SemaExpr.cpp | |
parent | ddfa6d51fba3b806ecb4d7716c7e27b57b3feddd (diff) | |
download | clang-f6da0fd888382d274bbb0bfceab4724c701b4922.tar.gz clang-f6da0fd888382d274bbb0bfceab4724c701b4922.tar.bz2 clang-f6da0fd888382d274bbb0bfceab4724c701b4922.tar.xz |
Objective-C. Diagnose assigning a block pointer type to
an Objective-C object type other than 'id'.
// rdar://16739120
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209906 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index 9b4c6382dc..be00c0e8b3 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -6435,8 +6435,8 @@ Sema::CheckAssignmentConstraints(QualType LHSType, ExprResult &RHS, return IncompatiblePointer; } - // T^ -> A* - if (RHSType->isBlockPointerType()) { + // T^ -> id; not T^ ->A* and not T^ -> id<P> + if (RHSType->isBlockPointerType() && LHSType->isObjCIdType()) { maybeExtendBlockObject(*this, RHS); Kind = CK_BlockPointerToObjCPointerCast; return Compatible; |