https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96400
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever confirmed|0 |1 Last reconfirmed| |2021-07-27 --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Here is the most reduced C++20 testcase which produce the warning: void test(auto){} void func() { static auto is_zero = [](){ }; test([](auto v){return is_zero(*v);}); } Here is a C++17 testcase: template<typename t> void test(t){} void func() { static auto is_zero = [](){ }; test([](auto v){return is_zero(*v);}); }