The documentation for C++11 attribute specifier sequence includes examples of GNU namespace attributes, e.g.
[[gnu::always_inline]] [[gnu::hot]] [[gnu::const]] [[nodiscard]]
inline int f(); // declare f with four attributes
The GCC documentation for attributes prior to C++11 uses different syntax
__attribute__(( ... ))
I can't find documentation for which of the GNU attributes use the new [[gnu:foo]] syntax, or what the differences are.
Where is the definitive documentation for this?
This is a hole in the GCC documentation, and maintainers are aware of it. See GCC Bug 102397 - Documentation of attribute syntax does not discuss C++11 / C23 attribute syntax.
Presently, it looks like all GNU attributes are registered in the gnu:: namespace:
/* Put all the GNU attributes into the "gnu" namespace. */
register_scoped_attributes (attribute_tables[i], "gnu");
gcc-mirror, attribs.cc
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With