The code as follows
#include <tuple>
int main()
{
auto [a] = std::make_tuple(1);
return [a]() -> int { return a; }();
}
produces an error in clang 12:
<source>:6:13: error: 'a' in capture list does not name a variable
return [a]() -> int { return a; }();
<source>:6:34: error: reference to local binding 'a' declared in enclosing function 'main'
return [a]() -> int { return a; }();
Hovewer both Visual Studio 2019 and gcc 11 with -std=c++20 -Wall -Wextra -pedantic-errors
accept it. https://gcc.godbolt.org/z/jbjsnfWfj
So they both still violate the rule that that structured bindings are never names of variables, making them never capturable?