From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3712 invoked by alias); 2 May 2012 10:48:46 -0000 Received: (qmail 3700 invoked by uid 22791); 2 May 2012 10:48:45 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,KHOP_THREADED X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 02 May 2012 10:48:32 +0000 From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/53184] Unnecessary anonymous namespace warnings Date: Wed, 02 May 2012 10:48:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: CC Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-05/txt/msg00089.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53184 Jonathan Wakely changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jason at gcc dot gnu.org --- Comment #3 from Jonathan Wakely 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