From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30912 invoked by alias); 23 Mar 2007 02:37:24 -0000 Received: (qmail 30842 invoked by uid 48); 23 Mar 2007 02:37:08 -0000 Date: Fri, 23 Mar 2007 02:37:00 -0000 Message-ID: <20070323023708.30841.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/31187] [4.2/4.3 regression] extern declaration of variable in anonymous namespace prevents use of its address as template argument In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "bangerth at dealii dot org" 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: 2007-03/txt/msg02185.txt.bz2 ------- Comment #4 from bangerth at dealii dot org 2007-03-23 02:37 ------- Without wanting to be a distractor, but can variables of a type that was declared in an anonymous namespace really have external linkage? Think of the type being declared in a header file and one .cc file has the variable declaration/definition and another one an extern declaration for that variable. Do they refer to the same variable? I don't think so -- they have the same name, but distinct types, so we have an ODR violation. IMHO, variables with a type that comes from an anonymous namespace can but have internal linkage. W. -- bangerth at dealii dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bangerth at dealii dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31187