Followup to r183931 to fix the lambda conversion-to-block-pointer member.

llvm-svn: 183942
This commit is contained in:
Eli Friedman 2013-06-13 20:56:27 +00:00
parent 280e5cb653
commit ef10282a0f
2 changed files with 11 additions and 2 deletions

View File

@ -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);

View File

@ -60,6 +60,15 @@ void take_block(void (^block)()) { block(); }
}
@end
// ARC: attributes [[NUW]] = { nounwind{{.*}} }
typedef int (^fptr)();
template<typename T> struct StaticMembers {
static fptr f;
};
template<typename T>
fptr StaticMembers<T>::f = [] { auto f = []{return 5;}; return fptr(f); }();
template fptr StaticMembers<float>::f;
// ARC: define linkonce_odr i32 ()* @_ZZNK13StaticMembersIfE1fMUlvE_clEvENKUlvE_cvU13block_pointerFivEEv
// ARC: attributes [[NUW]] = { nounwind{{.*}} }
// MRC: attributes [[NUW]] = { nounwind{{.*}} }