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