https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88164
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
For test, clang rejects it with:
<source>:15:18: error: variable 'a' cannot be implicitly captured in a lambda
with no capture-default specified
return f(a); // Unexpected: does not call the copy constructor,
^
<source>:13:17: note: 'a' declared here
constexpr A a{};
^
<source>:14:19: note: lambda expression begins here
auto lambda = []{
^
<source>:14:20: note: capture 'a' by value
auto lambda = []{
^
a
<source>:14:20: note: capture 'a' by reference
auto lambda = []{
^
&a
<source>:14:20: note: default capture by value
auto lambda = []{
^
=
<source>:14:20: note: default capture by reference
auto lambda = []{
^
&