diff options
| author | Fariborz Jahanian <fjahanian@apple.com> | 2010-03-17 00:20:01 +0000 |
|---|---|---|
| committer | Fariborz Jahanian <fjahanian@apple.com> | 2010-03-17 00:20:01 +0000 |
| commit | b8b0ea330ce08eafa0abcc2a10aada205f76bce2 (patch) | |
| tree | d80e99fe64d139006cbcd73a5d3f4e951b0ec43f /clang/lib/Sema | |
| parent | 5444aa6d3d989cd2efc57bf0d28b8e693fe19fc9 (diff) | |
| download | bcm5719-llvm-b8b0ea330ce08eafa0abcc2a10aada205f76bce2.tar.gz bcm5719-llvm-b8b0ea330ce08eafa0abcc2a10aada205f76bce2.zip | |
objective-c patch to provide type safty when blocks are passing or
returning objc objects. There will be a corresponding objective-c++
patch soon.
llvm-svn: 98696
Diffstat (limited to 'clang/lib/Sema')
| -rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index d80b25d332c..a4846a94633 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -4579,7 +4579,11 @@ Sema::CheckBlockPointerTypesForAssignment(QualType lhsType, if (lhptee.getLocalCVRQualifiers() != rhptee.getLocalCVRQualifiers()) ConvTy = CompatiblePointerDiscardsQualifiers; - if (!Context.typesAreCompatible(lhptee, rhptee)) + if (!getLangOptions().CPlusPlus) { + if (!Context.typesAreBlockPointerCompatible(lhsType, rhsType)) + return IncompatibleBlockPointer; + } + else if (!Context.typesAreCompatible(lhptee, rhptee)) return IncompatibleBlockPointer; return ConvTy; } |

