Don't allow structured binding declarations to decompose a
authorRichard Smith <richard@metafoo.co.uk>
Fri, 23 Oct 2020 23:13:49 +0000 (16:13 -0700)
committerRichard Smith <richard@metafoo.co.uk>
Fri, 23 Oct 2020 23:28:25 +0000 (16:28 -0700)
commitccca93b5a2cb284dcdfecd34db1ca14632d6a1c1
tree4d3164cca072c6507ca6375ae5cd56c408041e00
parent1b5baa42bc93432e6ae33e0a0fdce4d3e7c98dcb
Don't allow structured binding declarations to decompose a
lambda-expression's captures.

The built-in structured binding rules for classes require that all
fields can be accessed by name, and the fields introduced for lambda
captures are unnamed, so decomposing a capturing lambda is ill-formed.
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/lib/Sema/SemaDeclCXX.cpp
clang/test/SemaCXX/cxx1z-decomposition.cpp