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

--- Comment #3 from Mital Ashok <mital at mitalashok dot co.uk> ---
My real code looks more like:

void sat_inc(int& y) {
    if (y < __INT_MAX__)
        ++y;
}

template<typename... F>
void f(int& x, F&&... functions) {
    int copy = x;
    (functions(copy), ...);
    if (copy > x)
        x = copy;
}

void g(int& x) {
    f(x, sat_inc);
}

... Where `g(x)` became `++x` unconditionally

Reply via email to