[PATCH] [C++11] Support for capturing of variable length arrays in lambda expression.

Alexey Bataev a.bataev at hotmail.com
Mon Jul 21 05:43:04 PDT 2014


Updated version after last review. Unfortunately, I don't think it is possible to pass captured expression as a VariableLengthArray *. I have to capture expr of VariableLengthArray * and then cast it to SizeExpr->getType() type to make lambda capture this type, not VariableLengthArray *. I have to pass actual value of SizeExpr to the Lambda in this field, because it is defined only in calling function and in Lambda it can be received only in one of captured fields.

http://reviews.llvm.org/D4368

Files:
  include/clang/AST/Decl.h
  include/clang/AST/LambdaCapture.h
  include/clang/Basic/DiagnosticSemaKinds.td
  lib/AST/Decl.cpp
  lib/AST/Expr.cpp
  lib/AST/ExprCXX.cpp
  lib/AST/StmtPrinter.cpp
  lib/AST/StmtProfile.cpp
  lib/CodeGen/CGDebugInfo.cpp
  lib/CodeGen/CGExprCXX.cpp
  lib/CodeGen/CodeGenFunction.cpp
  lib/Sema/SemaDecl.cpp
  lib/Sema/SemaExpr.cpp
  lib/Sema/TreeTransform.h
  test/CodeGenCXX/instantiate-typeof-vla.cpp
  test/SemaTemplate/instantiate-typeof.cpp
  tools/libclang/IndexBody.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D4368.11707.patch
Type: text/x-patch
Size: 22247 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140721/99d5c298/attachment.bin>


More information about the cfe-commits mailing list