https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83503
--- Comment #6 from Martin Sebor <msebor at gcc dot gnu.org> --- The conflict between const and pure is in the expectations at the call site and guarantees provided by the function. A caller that assumes the function is pure (e.g., based on its declaration immediately prior to the call) may not behave correctly if the function is later declared const, even if its implementation is only pure. We discussed this extensively during the review of the patch (see for example: https://gcc.gnu.org/ml/gcc-patches/2017-08/msg00711.html). That aside, I believe the root cause of the warning here is bug 83871 (which this bug depends on). Once that bug is fixed the warning will disappear.