From: Eli Friedman Date: Thu, 13 Jun 2013 20:56:27 +0000 (+0000) Subject: Followup to r183931 to fix the lambda conversion-to-block-pointer member. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=95099ef43aff8fb3d5d47bed0a583e7977f4b3f4;p=clang Followup to r183931 to fix the lambda conversion-to-block-pointer member. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183942 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaLambda.cpp b/lib/Sema/SemaLambda.cpp index 469756cf4d..d8e90e5cb5 100644 --- a/lib/Sema/SemaLambda.cpp +++ b/lib/Sema/SemaLambda.cpp @@ -900,7 +900,7 @@ static void addBlockPointerConversion(Sema &S, DeclarationNameInfo(Name, Loc, NameLoc), ConvTy, S.Context.getTrivialTypeSourceInfo(ConvTy, Loc), - /*isInline=*/false, /*isExplicit=*/false, + /*isInline=*/true, /*isExplicit=*/false, /*isConstexpr=*/false, CallOperator->getBody()->getLocEnd()); Conversion->setAccess(AS_public); diff --git a/test/CodeGenObjCXX/lambda-expressions.mm b/test/CodeGenObjCXX/lambda-expressions.mm index c73e1727d6..acb8efb4b5 100644 --- a/test/CodeGenObjCXX/lambda-expressions.mm +++ b/test/CodeGenObjCXX/lambda-expressions.mm @@ -60,6 +60,15 @@ void take_block(void (^block)()) { block(); } } @end -// ARC: attributes [[NUW]] = { nounwind{{.*}} } +typedef int (^fptr)(); +template struct StaticMembers { + static fptr f; +}; +template +fptr StaticMembers::f = [] { auto f = []{return 5;}; return fptr(f); }(); +template fptr StaticMembers::f; +// ARC: define linkonce_odr i32 ()* @_ZZNK13StaticMembersIfE1fMUlvE_clEvENKUlvE_cvU13block_pointerFivEEv + +// ARC: attributes [[NUW]] = { nounwind{{.*}} } // MRC: attributes [[NUW]] = { nounwind{{.*}} }