This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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

--- Comment #13 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Martin Sebor from comment #12)
> AFAIK, specifying attribute const and pure on a function definition has no
> effect on the code emitted for the function itself or on its callers in
> other translation units, so what you describe doesn't sound meaningful.

The attribute on function definition affects all code in that TU.
Or, look at e.g. glibc external vs. internal headers, external headers are
something that is for users outside of glibc, internal headers include the
external ones and can tweak stuff for the internal users.  External header
could use pure attribute, internal could use const attribute (or just one
internal header for a particular sysdep etc.).  Many other projects use similar
header schemes.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]