[Bug other/54265] Documentation of "preferred attribute syntax for Types" contradicts examples in info.

sandra at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Nov 23 19:01:00 GMT 2018


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

sandra at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2018-11-23
                 CC|                            |sandra at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from sandra at gcc dot gnu.org ---
The language has been changed a little bit since this PR was filed, but the
problem still exists on trunk.

The text that "the former syntax is preferred" originated in r115086, a patch
to overhaul the implementation of the "visibility" attribute in C++.  The
"visibility" attribute for C++ classes has the restriction that it has to
appear before the body of the class.  But I didn't see any discussion or
justification about why this should be a general preference for all attributes
in the mail thread for that patch, which starts here:

https://gcc.gnu.org/ml/gcc-patches/2006-06/msg01302.html

Prior to that the text just presented both possible locations for type
attributes without saying one was better than the other.  I think the best fix
for this is to remove the problematic recommendation again.  The docs for the
"visibility" type attribute do explicitly say that it has to go before the
class body, and I think that's adequate.


More information about the Gcc-bugs mailing list