https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93842
kuzniar95 at o2 dot pl changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |UNCONFIRMED Resolution|INVALID |--- --- Comment #7 from kuzniar95 at o2 dot pl --- Oh, actually I'm reopening as it still incorrectly accepts code it shouldn't. I made a wrong assumption because I incorrectly tested that using not_odr_use function before. So, once more: ----------------------- void not_odr_use(char const); void odr_use(char const&); int main() { constexpr char ch = '='; [] { not_odr_use(ch); }; // compiles, OK [] { odr_use(ch); }; // doesn't compile, OK [](auto) { not_odr_use(ch); }; // compiles, OK [](auto) { odr_use(ch); }; // compiles, NOT OK (GCC should require lambda capture) } ----------------------- Previous investigation on "-Wunused" is correct, i.e. if the user doesn't instantiate a generic lambda's function call operator, it should be a warning.