[PATCH] Fix an instantiation error with nested generic lambdas and fptrs
Richard Smith
richard at metafoo.co.uk
Wed Oct 23 16:38:11 PDT 2013
A few tweaks then LGTM
================
Comment at: lib/Sema/SemaLambda.cpp:880
@@ +879,3 @@
+ InvokerExtInfo.ExtInfo = InvokerExtInfo.ExtInfo.withCallingConv(CC);
+ InvokerExtInfo.TypeQuals = 0;
+ InvokerFunctionTy = S.Context.getFunctionType(CallOpProto->getResultType(),
----------------
Maybe assert that there is no RefQualifier here?
================
Comment at: lib/Sema/SemaLambda.cpp:922
@@ +921,3 @@
+ TypeSourceInfo *ConvTSI = S.Context.getTrivialTypeSourceInfo(ConvTy, Loc);
+ // Get the conversion functions TypeLoc as a FunctinoProtoTypeLoc...
+ FunctionProtoTypeLoc ConvTL =
----------------
Typo `Functino`. But drop this comment, it doesn't add anything to the code.
================
Comment at: lib/Sema/SemaLambda.cpp:1017
@@ -941,14 +1016,3 @@
CallOperator->getBody()->getLocEnd());
- SmallVector<ParmVarDecl *, 4> InvokeParams;
- for (unsigned I = 0, N = CallOperator->getNumParams(); I != N; ++I) {
- ParmVarDecl *From = CallOperator->getParamDecl(I);
- InvokeParams.push_back(ParmVarDecl::Create(S.Context, Invoke,
- From->getLocStart(),
- From->getLocation(),
- From->getIdentifier(),
- From->getType(),
- From->getTypeSourceInfo(),
- From->getStorageClass(),
- /*DefaultArg=*/0));
- }
- Invoke->setParams(InvokeParams);
+ for (unsigned I = 0, N = CallOperator->getNumParams(); I < N; ++I)
+ InvokerParams[I]->setOwningFunction(Invoke);
----------------
`I != N`?
================
Comment at: lib/Sema/SemaLambda.cpp:882
@@ +881,3 @@
+ InvokerFunctionTy = S.Context.getFunctionType(CallOpProto->getResultType(),
+ CallOpProto->getArgTypes(), InvokerExtInfo);
+ PtrToFunctionTy = S.Context.getPointerType(InvokerFunctionTy);
----------------
Reindent.
http://llvm-reviews.chandlerc.com/D1831
More information about the cfe-commits
mailing list