llvm-project/clang/tools/libclang
Corentin Jabot 127bf44385 [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
2022-08-04 10:12:53 +02:00
..
ARCMigrate.cpp
BuildSystem.cpp [llvm] Cleanup header dependencies in ADT and Support 2022-01-21 13:54:49 +01:00
CIndex.cpp [Clang][C++20] Support capturing structured bindings in lambdas 2022-08-04 10:12:53 +02:00
CIndexCXX.cpp
CIndexCodeCompletion.cpp [CodeCompletion] Signature help for braced constructor calls 2022-01-03 20:14:59 +01:00
CIndexDiagnostic.cpp
CIndexDiagnostic.h
CIndexHigh.cpp [clang] Use llvm::is_contained (NFC) 2021-10-13 20:41:55 -07:00
CIndexInclusionStack.cpp
CIndexUSRs.cpp
CIndexer.cpp Use static_cast from SmallString to std::string (NFC) 2022-06-04 22:09:27 -07:00
CIndexer.h
CLog.h
CMakeLists.txt libclang.so: Make SONAME the same as LLVM version 2022-07-25 22:03:34 -07:00
CXComment.cpp
CXComment.h
CXCompilationDatabase.cpp
CXCursor.cpp [OpenMP] Initial parsing and semantic support for 'parallel masked taskloop simd' construct 2022-07-01 08:57:15 -07:00
CXCursor.h
CXIndexDataConsumer.cpp [libclang] add supporting for indexing/visiting C++ concepts 2022-05-24 10:02:53 -07:00
CXIndexDataConsumer.h [libclang] add supporting for indexing/visiting C++ concepts 2022-05-24 10:02:53 -07:00
CXLoadedDiagnostic.cpp [clang] Remove redundant member initialization (NFC) 2022-01-02 10:20:23 -08:00
CXLoadedDiagnostic.h
CXSourceLocation.cpp
CXSourceLocation.h
CXStoredDiagnostic.cpp
CXString.cpp
CXString.h
CXTranslationUnit.h
CXType.cpp [clang] Don't use Optional::getValue (NFC) 2022-06-20 22:59:26 -07:00
CXType.h [clang] Remove unused forward declarations (NFC) 2022-01-09 12:21:00 -08:00
CursorVisitor.h [libclang] add supporting for indexing/visiting C++ concepts 2022-05-24 10:02:53 -07:00
FatalErrorHandler.cpp [clang] FatalErrorHandler.cpp - add explicit <stdio.h> include 2021-10-05 17:03:17 +01:00
Index_Internal.h
Indexing.cpp [Frontend] Flip default of CreateInvocationOptions::ProbePrecompiled to false 2022-05-10 16:58:13 +02:00
Rewrite.cpp
libclang.exports libclang.so: Make SONAME the same as LLVM version 2022-07-25 22:03:34 -07:00