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++/53184] Unnecessary anonymous namespace warnings


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53184

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu.org

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-05-02 10:48:18 UTC ---
(In reply to comment #2)
> The warning is meant for types
> inside anonymous namespaces, which is not the case here.

Technically it triggers for types with "anon" visibility, which is usually (but
not always) caused by being declared in an anonymous namespace.  Andrew's right
the wording could be improved so it's not misleading in cases such as this.

> Moreover, removing the volatile keyword resolves the warning. Why is that?

Because then the anonymous class has the name "Foo" for linkage purposes, and
has external linkage.  When Foo referes to the const or volatile qualified form
of the class, the anonymous class itself has no name and so no linkage, only
the cv-qualified form has a name for linkage purposes.

I'm not sure if that behaviour is correct though, let's ask Jason


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