[all-commits] [llvm/llvm-project] 127bf4: [Clang][C++20] Support capturing structured bindin...

cor3ntin via All-commits all-commits at lists.llvm.org
Thu Aug 4 01:13:10 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 127bf44385424891eb04cff8e52d3f157fc2cb7c
      https://github.com/llvm/llvm-project/commit/127bf44385424891eb04cff8e52d3f157fc2cb7c
  Author: Corentin Jabot <corentinjabot at gmail.com>
  Date:   2022-08-04 (Thu, 04 Aug 2022)

  Changed paths:
    M clang-tools-extra/clang-tidy/modernize/LoopConvertUtils.cpp
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang/AST/Decl.h
    M clang/include/clang/AST/DeclCXX.h
    M clang/include/clang/AST/LambdaCapture.h
    M clang/include/clang/AST/Stmt.h
    M clang/include/clang/ASTMatchers/ASTMatchers.h
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/include/clang/Sema/ScopeInfo.h
    M clang/include/clang/Sema/Sema.h
    M clang/lib/AST/ASTImporter.cpp
    M clang/lib/AST/Decl.cpp
    M clang/lib/AST/DeclCXX.cpp
    M clang/lib/AST/ExprCXX.cpp
    M clang/lib/AST/ExprConstant.cpp
    M clang/lib/AST/StmtPrinter.cpp
    M clang/lib/Analysis/AnalysisDeclContext.cpp
    M clang/lib/CodeGen/CGDebugInfo.cpp
    M clang/lib/CodeGen/CGExpr.cpp
    M clang/lib/CodeGen/CGOpenMPRuntime.cpp
    M clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp
    M clang/lib/CodeGen/CodeGenFunction.h
    M clang/lib/Sema/SemaDecl.cpp
    M clang/lib/Sema/SemaExpr.cpp
    M clang/lib/Sema/SemaInit.cpp
    M clang/lib/Sema/SemaLambda.cpp
    M clang/lib/Sema/SemaOpenMP.cpp
    M clang/lib/Sema/SemaStmt.cpp
    M clang/lib/Sema/TreeTransform.h
    M clang/lib/Serialization/ASTWriter.cpp
    M clang/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp
    M clang/lib/StaticAnalyzer/Checkers/WebKit/UncountedLambdaCapturesChecker.cpp
    M clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
    M clang/lib/StaticAnalyzer/Core/LoopUnrolling.cpp
    A clang/test/CodeGenCXX/cxx20-decomposition.cpp
    M clang/test/SemaCXX/cxx1z-decomposition.cpp
    A clang/test/SemaCXX/cxx20-decomposition.cpp
    A clang/test/SemaCXX/decomposition-blocks.cpp
    A clang/test/SemaCXX/decomposition-openmp.cpp
    M clang/tools/libclang/CIndex.cpp
    M clang/www/cxx_status.html

  Log Message:
  -----------
  [Clang][C++20] Support capturing structured bindings in lambdas

This completes the implementation of P1091R3 and P1381R1.

This patch allow the capture of structured bindings
both for C++20+ and C++17, with extension/compat warning.

In addition, capturing an anonymous union member,
a bitfield, or a structured binding thereof now has a
better diagnostic.

We only support structured bindings - as opposed to other kinds
of structured statements/blocks. We still emit an error for those.

In addition, support for structured bindings capture is entirely disabled in
OpenMP mode as this needs more investigation - a specific diagnostic indicate the feature is not yet supported there.

Note that the rest of P1091R3 (static/thread_local structured bindings) was already implemented.

at the request of @shafik, i can confirm the correct behavior of lldb wit this change.

Fixes https://github.com/llvm/llvm-project/issues/54300
Fixes https://github.com/llvm/llvm-project/issues/54300
Fixes https://github.com/llvm/llvm-project/issues/52720

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D122768




More information about the All-commits mailing list