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

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Consider:

template<class Func>
int call (Func f)
{
    static int counter;
    f ();
    return ++counter;
}

void func () noexcept
{
}

Now if call(func) is evaluated in two different translation units, one using
C++14 and one using C++17, you get two different counters.

The fact it's a function template doesn't mean there's no consequence of the
change, and whether it's inlined is irrelevant.

Maybe if the function is known to be pure and is there's no explicitly
instantiation declaration or definition the warning would be redundant.

Reply via email to