aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2012-08-07 06:14:34 +0000
committerDouglas Gregor <dgregor@apple.com>2012-08-07 06:14:34 +0000
commitb38b49140990ae123b5290a54c500013bf614b8b (patch)
tree6e8662ceb80fe5b1b5b3b58ae384d1ddbf8d23b0
parent60b70388e43d146d968a1cc0705b30cb2d7263fe (diff)
Objective-C pointer types don't have C-linkage, even though they are
non-POD. Fixes <rdar://problem/12031870>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161395 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Sema/SemaDecl.cpp3
-rw-r--r--test/SemaObjCXX/arc-0x.mm3
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index a512c0364c..ffe45fad03 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -6031,7 +6031,8 @@ bool Sema::CheckFunctionDeclaration(Scope *S, FunctionDecl *NewFD,
if (R->isIncompleteType() && !R->isVoidType())
Diag(NewFD->getLocation(), diag::warn_return_value_udt_incomplete)
<< NewFD << R;
- else if (!R.isPODType(Context) && !R->isVoidType())
+ else if (!R.isPODType(Context) && !R->isVoidType() &&
+ !R->isObjCObjectPointerType())
Diag(NewFD->getLocation(), diag::warn_return_value_udt) << NewFD << R;
}
}
diff --git a/test/SemaObjCXX/arc-0x.mm b/test/SemaObjCXX/arc-0x.mm
index 49ce145438..e24b9602fb 100644
--- a/test/SemaObjCXX/arc-0x.mm
+++ b/test/SemaObjCXX/arc-0x.mm
@@ -11,6 +11,9 @@ void move_it(__strong id &&from) {
- init;
@end
+// <rdar://problem/12031870>: don't warn about this
+extern "C" A* MakeA();
+
// Ensure that deduction works with lifetime qualifiers.
void deduction(id obj) {
auto a = [[A alloc] init];