[PATCH] Implement capturing for generic lambdas

Richard Smith richard at metafoo.co.uk
Wed Nov 6 20:02:53 PST 2013


  LGTM. Does this mean generic lambdas are done? :)


================
Comment at: include/clang/Sema/ScopeInfo.h:725
@@ +724,3 @@
+  /// capture such variables. 
+  ///    
+  void markVariableExprAsNonODRUsed(Expr *CapturingVarExpr) {
----------------
Faisal Vali wrote:
> This is a very illuminating comment:
> "The problem is that the set of captures for a lambda is part of the ABI
> (since lambda layout can be made visible through inline functions and the
> like), and there are no guarantees as to which cases we'll manage to build
> an lvalue-to-rvalue conversion in, when parsing a template -- some
> seemingly harmless change elsewhere in Sema could cause us to start or stop
> building such a node. So we need a rule that anyone can implement and get
> exactly the same result."
> 
> I'd like to add this here - so as to discourage others from venturing on this potentially fool-hardy errand.
> Thanks!!
Sounds good.


http://llvm-reviews.chandlerc.com/D2035



More information about the cfe-commits mailing list