https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83503
--- Comment #8 from Martin Sebor <msebor at gcc dot gnu.org> --- The purpose of the warning is to detect coding mistakes. There is no valid use case for declaring the same function const and pure so it must be a mistake. As the test case shows, the mistake can lead to subtle bugs. In this instance, the warning is a false positive caused by bug 83871 showing that the C++ front end applies the attribute from the primary template to its specialization. That's what should be fixed. Suppressing the warning by removing the conflicting attribute would only mask that underlying bug. If I'm reading Jason's patch in attachment 43275 right, it handles the underlying problem (i.e., fixes bug 83871). I'll try to find time to finish it up.