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

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
First of all, I was talking about a function first declared pure and later made
const, your invalid example has it the other way around, but the invalid thing
on it isn't any kind of attribute conflict, but rather violating the
requirements of the given attribute.
The attributes aren't something you are required to specify on every
declaration of the function, the standard behavior is that attributes are
merged from all the declarations, and the definition has to satisfy them all. 
const, as documented, is a special kind of pure with extra requirements.
If in your https://gcc.gnu.org/ml/gcc-patches/2017-08/msg00711.html testcase
you leave the pure attribute out on the definition, it is exactly as invalid as
before, you just don't emit a warning.
And from the thread I see just Joseph and Marek disagreeing with you on this
stuff.

Reply via email to