From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32454 invoked by alias); 2 Apr 2003 01:06:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 32435 invoked by uid 71); 2 Apr 2003 01:06:01 -0000 Resent-Date: 2 Apr 2003 01:06:01 -0000 Resent-Message-ID: <20030402010601.32434.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, sebor@roguewave.com Received: (qmail 30499 invoked by uid 48); 2 Apr 2003 00:56:07 -0000 Message-Id: <20030402005607.30498.qmail@sources.redhat.com> Date: Wed, 02 Apr 2003 01:06:00 -0000 From: sebor@roguewave.com Reply-To: sebor@roguewave.com To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/10291: error referencing a static local from a local struct in termplate code X-SW-Source: 2003-04/txt/msg00044.txt.bz2 List-Id: >Number: 10291 >Category: c++ >Synopsis: error referencing a static local from a local struct in termplate code >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: rejects-legal >Submitter-Id: net >Arrival-Date: Wed Apr 02 01:06:01 UTC 2003 >Closed-Date: >Last-Modified: >Originator: sebor@roguewave.com >Release: 3.2 >Organization: >Environment: >Description: The well-fomed program below fails to compile with gcc 3.2. Regards Martin >How-To-Repeat: $ cat t.cpp; gcc --version; gcc t.cpp template int foo () { static int i; struct S { int bar () { return i; } } s; return s.bar (); } int main () { foo(); } gcc (GCC) 3.2 Copyright (C) 2002 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. t.cpp: In member function `int foo()::S::bar() [with T = int]': t.cpp:12: instantiated from `int foo() [with T = int]' t.cpp:17: instantiated from here t.cpp:8: `i' undeclared (first use this function) t.cpp:8: (Each undeclared identifier is reported only once for each function it appears in.) >Fix: >Release-Note: >Audit-Trail: >Unformatted: