https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88804

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Inconsistently diagnosed    |incorrect unused but set
                   |unused but set static       |static variable in
                   |variable in lambda          |templated lambda

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Another example where the warning happens but should not:
void foo(int);
template <class T> void call(T t) {
    t(0);
}
void bar() {
        static int x=3;
        call([]<typename t>(t){
                foo(x);
        });
}

Basically the templated lambda is causing the static variable not be marked ...

Reply via email to