From b38b49140990ae123b5290a54c500013bf614b8b Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Tue, 7 Aug 2012 06:14:34 +0000 Subject: [PATCH] Objective-C pointer types don't have C-linkage, even though they are non-POD. Fixes . git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161395 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/SemaDecl.cpp | 3 ++- test/SemaObjCXX/arc-0x.mm | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) 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 +// : 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]; -- 2.40.0