[PATCH] Fix an instantiation error with nested generic lambdas and fptrs
Richard Smith
richard at metafoo.co.uk
Mon Oct 7 16:04:18 PDT 2013
================
Comment at: lib/Sema/SemaLambda.cpp:884
@@ +883,3 @@
+ ConvExtInfo.TypeQuals = Qualifiers::Const;
+ ConvExtInfo.HasTrailingReturn = CallOpExtInfo.HasTrailingReturn;
+ QualType ConvTy =
----------------
I don't think this makes sense. A conversion function never has an explicit return type, so it's not meaningful for it to have a trailing return type.
================
Comment at: lib/Sema/SemaLambda.cpp:889
@@ -881,3 +888,3 @@
SourceLocation Loc = IntroducerRange.getBegin();
- DeclarationName Name
+ DeclarationName ConversionOrInvokerName
= S.Context.DeclarationNames.getCXXConversionFunctionName(
----------------
Any reason to reuse the same `DeclarationName` for both, rather than having a separate `ConversionName` and `InvokerName`?
================
Comment at: lib/Sema/SemaLambda.cpp:945
@@ +944,3 @@
+
+ InvokerParams.push_back(ParmVarDecl::Create(S.Context,
+ // Temporarily add to the TU. This is set to the invoker below.
----------------
Faisal Vali wrote:
> Can I use the CallOperator's ParmVarDecls and do the same with the static-invoker (since it is a dummy function that forwards everything to the lambda's call operator?) - or do i absolutely have to create new ones?
>
Please create new ones (otherwise they will have the wrong parent).
http://llvm-reviews.chandlerc.com/D1831
More information about the cfe-commits
mailing list