summaryrefslogtreecommitdiffstats
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
commit847cea72e61229c54baafb37acdd7975d5d82493 (patch)
tree880d90d4c5d3982d0b7e1b984d123dace3400153
parent0acd0c0a69d77e7762422e547ffe4386db30e664 (diff)
downloadbcm5719-llvm-847cea72e61229c54baafb37acdd7975d5d82493.tar.gz
bcm5719-llvm-847cea72e61229c54baafb37acdd7975d5d82493.zip
Objective-C pointer types don't have C-linkage, even though they are
non-POD. Fixes <rdar://problem/12031870>. llvm-svn: 161395
-rw-r--r--clang/lib/Sema/SemaDecl.cpp3
-rw-r--r--clang/test/SemaObjCXX/arc-0x.mm3
2 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index a512c0364c7..ffe45fad039 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/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/clang/test/SemaObjCXX/arc-0x.mm b/clang/test/SemaObjCXX/arc-0x.mm
index 49ce145438e..e24b9602fb7 100644
--- a/clang/test/SemaObjCXX/arc-0x.mm
+++ b/clang/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];
OpenPOWER on IntegriCloud