From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22256 invoked by alias); 23 Mar 2004 20:15:09 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 22245 invoked by uid 48); 23 Mar 2004 20:15:09 -0000 Date: Tue, 23 Mar 2004 20:15:00 -0000 Message-ID: <20040323201509.22244.qmail@sources.redhat.com> From: "bangerth at dealii dot org" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20031120194900.13140.phil.el@wanadoo.fr> References: <20031120194900.13140.phil.el@wanadoo.fr> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/13140] declaration in global namespace, definition inside named or anon namespace X-Bugzilla-Reason: CC X-SW-Source: 2004-03/txt/msg02797.txt.bz2 List-Id: ------- Additional Comments From bangerth at dealii dot org 2004-03-23 20:15 ------- I actually tripped over this in my own program just now. To explain why this is a particularly evil bug: in a header file x.h I had struct X { void f(); }; and in y.h: namespace NS { struct X { void f(); }; } Then in x.cc, I would #include "x.h" void X::f() {}; but in y.cc I made the error to include x.h instead of y.h: #include "x.h" namespace NS { void X::f() {}; } This compiled without error, as explained in this PR, but I later got linker errors about multiply defined symbols X::f, despite the fact that I defined these symbols in the second .cc file in a namespace. It is thus not only accepts-invalid, but also wrong-code. Needless to say that it was rather tedious to find the problem... I take the liberty to set the milestone tentatively to 3.5, in the hope that someone comes along with a fix to this problem until then. W. -- What |Removed |Added ---------------------------------------------------------------------------- Keywords| |wrong-code Known to fail| |2.95.3 3.2.3 3.3.3 3.4.0 | |3.5.0 Target Milestone|--- |3.5.0 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13140