https://gcc.gnu.org/bugzilla/show_bug.cgi?id=18487
--- Comment #37 from Richard Biener <rguenth at gcc dot gnu.org> ---
Just pasting here what I said in the review:
Since we automatically detect functions as pure/const annotating
functions yourself is naturally exactly for the cases where you
either "know better" or auto analysis fails (usually because some
calls are to external functions). So I fail to see practical applicataion
here - whenever you'd use -Winvalid-pure-const you'd be better off
removing all explicit pure/const annotation. Which can be done
in a crude way as -Dpure=foobar -Dconst=foobar (OK, definitely
not the latter ;)).
So - do we instead want a -fno-attribute-{const,pure,...} flag,
similar to how we have -fno-builtin*?
So indeed WONTFIX (IMO) as very initially suggested.