https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95455
--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Clang gives: <source>:5:16: error: reference to local variable 'foo' declared in enclosing function 'f' [bar = foo] {}; ^ <source>:3:9: note: 'foo' declared here int foo; ^