[PATCH] D96975: [Sema] Add some basic lambda capture fix-its

Nathan James via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 19 07:41:19 PST 2021


njames93 updated this revision to Diff 324981.
njames93 added a comment.

Restrict availability of default capture fixit based on init captures already specified.
`[=, A]() {}` and `[&, &A]() {}` are both invalid as explicit captures can't be specified with the same type as default capture. 
So we shouldn't offer '=' fixit if any init captures are by value and '&' if any by ref.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D96975/new/

https://reviews.llvm.org/D96975

Files:
  clang/include/clang/Basic/DiagnosticSemaKinds.td
  clang/lib/Sema/SemaExpr.cpp
  clang/lib/Sema/SemaExprCXX.cpp
  clang/test/CXX/drs/dr6xx.cpp
  clang/test/CXX/expr/expr.prim/expr.prim.lambda/p12.cpp
  clang/test/CXX/expr/expr.prim/expr.prim.lambda/p2-generic-lambda-1y.cpp
  clang/test/SemaCXX/cxx1y-generic-lambdas-capturing.cpp
  clang/test/SemaCXX/cxx1y-generic-lambdas.cpp
  clang/test/SemaCXX/cxx1y-init-captures.cpp
  clang/test/SemaCXX/cxx1z-constexpr-lambdas.cpp
  clang/test/SemaCXX/lambda-expressions.cpp
  clang/test/SemaCXX/lambda-invalid-capture.cpp
  clang/test/SemaObjCXX/capturing-flexible-array-in-block.mm

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D96975.324981.patch
Type: text/x-patch
Size: 28358 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210219/91e62c7c/attachment-0001.bin>


More information about the cfe-commits mailing list