summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclAttr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema/SemaDeclAttr.cpp')
-rw-r--r--clang/lib/Sema/SemaDeclAttr.cpp4
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;
OpenPOWER on IntegriCloud