https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104765
Aaron Ballman <aaron at aaronballman dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |aaron at aaronballman dot com --- Comment #3 from Aaron Ballman <aaron at aaronballman dot com> --- Here's another example that causes diagnostics and then ICEs in a different way: https://godbolt.org/z/nWTGEc1dW template <typename Callable> int foo(Callable&& Call) { return Call(); } int main() { auto l = [](int a = ({ int x = 12; x; })) { return a; }; return foo(l); } (I was trying to see how well the locally-declared `x` in the lambda's default argument worked in practice.) Consider me a +1 for prohibiting statement expressions in lambda default arguments.