[PATCH] Implement transformations of non-capturing nested lambdas.
Faisal Vali
faisalv at yahoo.com
Fri Oct 4 21:34:49 PDT 2013
Fixes the crash that resulted in PR 17476.
The approach taken here seems much cleaner.
The original approach (pre-generic lambdas) was to transform the TypeSourceInfo of the Call operator (in its own instantiation scope), and then to add the parameters, call TransformFunctionParameters which would then add parameters (but newly created ones!!) to the instantiation scope. This would result in a disconnect between the new call operator's TSI parameters and those used to construct the call operator declaration. This was ok in the non-generic lambda world - but would cause issues with nested transformations (when non-generic and generics were interleaved) in the generic lambda world - that I somewhat kludged around initially - but this resulted in PR17476.
The new approach seems cleaner. - we only do the transformation of the TypeSourceInfo - but we make sure to do it in the current instantiation scope so we don't lose the untransformed to transformed mappings of the ParmVarDecls when they get created.
Hi doug.gregor, rsmith, eli.friedman, jdennett,
http://llvm-reviews.chandlerc.com/D1784
CHANGE SINCE LAST DIFF
http://llvm-reviews.chandlerc.com/D1784?vs=4564&id=4687#toc
Files:
lib/Sema/SemaTemplateInstantiate.cpp
lib/Sema/SemaTemplateInstantiateDecl.cpp
lib/Sema/TreeTransform.h
test/CXX/expr/expr.prim/expr.prim.lambda/generic-lambda-unimplemented-1y.cpp
test/SemaCXX/cxx1y-generic-lambdas.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D1784.3.patch
Type: text/x-patch
Size: 27047 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131004/36ad9ab5/attachment.bin>
More information about the cfe-commits
mailing list