[Bug c++/83503] [8 Regression] bogus -Wattributes for const and pure on function template specialization

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Jan 29 16:12:00 GMT 2018


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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
As I wrote on IRC, I fail to see what kind of conflict is there between
something previously declared pure and later declared const, const is just a
stronger pure, all const functions are necessarily pure.
With
__attribute__((pure)) int foo (int x, int y);
...
__attribute__((const)) int foo (int x, int y);
I see no harm, worst case some code will only assume the function is pure,
rather than const.


More information about the Gcc-bugs mailing list