diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2011-09-30 20:50:23 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2011-09-30 20:50:23 +0000 |
commit | 044a5be6fb376ccb81322dbd6ab5232d35f84da2 (patch) | |
tree | c5bbf6abf7d3d7dee22f3b296e11254cbe4ef97b /clang/lib/Sema/SemaDeclAttr.cpp | |
parent | 3bad73a900eb7e81ddb1b96985a6cecf3c5d985c (diff) | |
download | bcm5719-llvm-044a5be6fb376ccb81322dbd6ab5232d35f84da2.tar.gz bcm5719-llvm-044a5be6fb376ccb81322dbd6ab5232d35f84da2.zip |
objc arc: allow objc_returns_inner_pointer on methods that return
a reference type, since inner reference is much like an inner pointer.
// rdar://10139365
llvm-svn: 140880
Diffstat (limited to 'clang/lib/Sema/SemaDeclAttr.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDeclAttr.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp index 0ffb92f00f0..5802aaad968 100644 --- a/clang/lib/Sema/SemaDeclAttr.cpp +++ b/clang/lib/Sema/SemaDeclAttr.cpp @@ -3250,7 +3250,9 @@ static void handleObjCReturnsInnerPointerAttr(Sema &S, Decl *D, // Check that the method returns a normal pointer. QualType resultType = method->getResultType(); - if (!resultType->isPointerType() || resultType->isObjCRetainableType()) { + + if (!resultType->isReferenceType() && + (!resultType->isPointerType() || resultType->isObjCRetainableType())) { S.Diag(method->getLocStart(), diag::warn_ns_attribute_wrong_return_type) << SourceRange(loc) << attr.getName() << /*method*/ 1 << /*non-retainable pointer*/ 2; |