[Bug c++/17542] Visibility attribute ignored when it precedes class head
jsm at polyomino dot org dot uk
gcc-bugzilla@gcc.gnu.org
Fri Oct 1 23:29:00 GMT 2004
------- Additional Comments From jsm at polyomino dot org dot uk 2004-10-01 23:29 -------
Subject: Re: Visibility attribute ignored when it precedes
class head
On Fri, 1 Oct 2004, austern at apple dot com wrote:
> I hesitate to call this "behaves correctly", since this behavior is
> unexpected, hard to understand, and leads to the user silently not
> getting what they expected. I'm afraid that with visibility, in
> particular, it'll lead to problems because users will want to hide this
> attribute list behind macros that expand to different things on
> different platforms. But I'm also not completely sure what the best
> thing to do is.
It is at least documented to some extent ("Attribute Syntax"), although
with a warning that C++ may vary from C.
> 2. If cp_parser_simple_declaration collects attributes in
> cp_parser_decl_specifier_seq and it's throwing them away because there's
> no declarator to apply them to, then warn the user and suggest a better
> place to put the attribute list.
FWIW, I've been considering such a warning for C, to go along with the
warnings for useless type qualifiers and storage class specifiers on empty
declarations.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17542
More information about the Gcc-bugs
mailing list