[PATCH] Generic Lambdas: The next step

Faisal Vali faisalv at yahoo.com
Tue Sep 17 22:16:35 PDT 2013


  Cleaned up some commented out code and fixed some bugs in the capture semantics for variables and this.
     - for e.g. now before we try and capture a potentially un-odr-used variable, we check to see if the entire intervening enclosing chain can capture it - if the intervening chain can't, then we wait for the instantiation of the generic lambda to emit the appropriate odr-use violation.

  For 'this' capturing in generic lambdas
    - if the implicit-member access is unresolvable (because of dependence on the generic lambda parameter), and name lookup finds a non-static member function in the lookup set (regardless of viability), and every enclosing lambda can capture 'this' then the lambda with the implicit-member-access must capture it - otherwise we wait for the instantiation, and if it resolves to a member-acess, we emit an error.

  Look forward to some feedback.

  Thanks!

Hi rsmith, doug.gregor, eli.friedman,

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

CHANGE SINCE LAST DIFF
  http://llvm-reviews.chandlerc.com/D1174?vs=4311&id=4362#toc

Files:
  include/clang/AST/ASTContext.h
  include/clang/AST/ASTLambda.h
  include/clang/AST/DeclCXX.h
  include/clang/AST/ExprCXX.h
  include/clang/AST/Type.h
  include/clang/Basic/DiagnosticSemaKinds.td
  include/clang/Sema/DeclSpec.h
  include/clang/Sema/ScopeInfo.h
  include/clang/Sema/Sema.h
  include/clang/Sema/SemaLambda.h
  lib/AST/ASTContext.cpp
  lib/AST/ASTImporter.cpp
  lib/AST/Decl.cpp
  lib/AST/DeclCXX.cpp
  lib/AST/ExprCXX.cpp
  lib/AST/Type.cpp
  lib/CodeGen/CGClass.cpp
  lib/CodeGen/CodeGenFunction.cpp
  lib/CodeGen/CodeGenFunction.h
  lib/Parse/ParseDecl.cpp
  lib/Parse/ParseExprCXX.cpp
  lib/Parse/Parser.cpp
  lib/Parse/ParseTemplate.cpp
  lib/Sema/Sema.cpp
  lib/Sema/SemaDecl.cpp
  lib/Sema/SemaDeclCXX.cpp
  lib/Sema/SemaDeclObjC.cpp
  lib/Sema/SemaExpr.cpp
  lib/Sema/SemaExprCXX.cpp
  lib/Sema/SemaExprMember.cpp
  lib/Sema/SemaLambda.cpp
  lib/Sema/SemaOverload.cpp
  lib/Sema/SemaStmt.cpp
  lib/Sema/SemaTemplateDeduction.cpp
  lib/Sema/SemaTemplateInstantiate.cpp
  lib/Sema/SemaTemplateInstantiateDecl.cpp
  lib/Sema/SemaType.cpp
  lib/Sema/TreeTransform.h
  lib/Serialization/ASTReader.cpp
  lib/Serialization/ASTReaderDecl.cpp
  lib/Serialization/ASTWriter.cpp
  test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p3-generic-lambda-1y.cpp
  test/CXX/expr/expr.prim/expr.prim.lambda/generic-lambda-capturing.cpp
  test/CXX/expr/expr.prim/expr.prim.lambda/p2-generic-lambda-1y.cpp
  test/CXX/expr/expr.prim/expr.prim.lambda/p4-1y.cpp
  test/CXX/expr/expr.prim/expr.prim.lambda/p4.cpp
  test/CXX/expr/expr.prim/expr.prim.lambda/p5-generic-lambda-1y.cpp
  test/Parser/DelayedTemplateParsing.cpp
  test/PCH/cxx1y-lambdas.mm
  test/SemaCXX/cxx1y-deduced-return-type.cpp
  test/SemaCXX/cxx1y-generic-lambdas.cpp
  test/SemaCXX/lambda-expressions.cpp
  test/SemaTemplate/ms-function-specialization-class-scope.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D1174.7.patch
Type: text/x-patch
Size: 244125 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130917/0ea7774c/attachment.bin>


More information about the cfe-commits mailing list