llvm-project/clang/lib/StaticAnalyzer/Checkers/WebKit
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
..
ASTUtils.cpp [Analyzer][WebKit] Use tri-state types for relevant predicates 2020-09-22 21:57:24 -07:00
ASTUtils.h [clang] Remove unused forward declarations (NFC) 2022-01-08 11:56:40 -08:00
DiagOutputUtils.h [Analyzer][WebKit] NoUncountedMembersChecker 2020-05-27 19:46:32 -07:00
NoUncountedMembersChecker.cpp [Analyzer][WebKit] Use tri-state types for relevant predicates 2020-09-22 21:57:24 -07:00
PtrTypesSemantics.cpp [Analyzer][WebKit] Use tri-state types for relevant predicates 2020-09-22 21:57:24 -07:00
PtrTypesSemantics.h [clang] Remove unused forward declarations (NFC) 2022-01-08 11:56:40 -08:00
RefCntblBaseVirtualDtorChecker.cpp [Analyzer][WebKit] Use tri-state types for relevant predicates 2020-09-22 21:57:24 -07:00
UncountedCallArgsChecker.cpp [clang] Use isa instead of dyn_cast (NFC) 2021-11-14 09:32:40 -08:00
UncountedLambdaCapturesChecker.cpp [Clang][C++20] Support capturing structured bindings in lambdas 2022-08-04 10:12:53 +02:00
UncountedLocalVarsChecker.cpp [Analyzer][WebKit] Use tri-state types for relevant predicates 2020-09-22 21:57:24 -07:00