From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1438 invoked by alias); 6 Jun 2002 20:36:02 -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 1416 invoked by uid 71); 6 Jun 2002 20:36:01 -0000 Resent-Date: 6 Jun 2002 20:36:01 -0000 Resent-Message-ID: <20020606203601.1415.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, rubin@contractor.net Received:(qmail 32321 invoked by uid 61); 6 Jun 2002 20:30:19 -0000 Message-Id:<20020606203019.32319.qmail@sources.redhat.com> Date: Thu, 06 Jun 2002 13:36:00 -0000 From: rubin@contractor.net Reply-To: rubin@contractor.net To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version:gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/6949: ICE in tsubst_decl, at cp/pt.c:5733 X-SW-Source: 2002-06/txt/msg00134.txt.bz2 List-Id: >Number: 6949 >Category: c++ >Synopsis: ICE in tsubst_decl, at cp/pt.c:5733 >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: ice-on-legal-code >Submitter-Id: net >Arrival-Date: Thu Jun 06 13:36:01 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Bill Rubin >Release: 3.1 >Organization: >Environment: Cygwin on Windows XP Professional >Description: This ICE is caused by a class nested inside a local class of a templated member function. The code snippet below is illustrative of the ICE in my application. I found that small changes in the snippet cause the ICE to disappear, or to pop up in another place. For example, just replacing void funct(); with void funct(){} causes the ICE to disappear! //========= Compiler output ================ $ gcc -v -save-temps GccBug2.cpp Reading specs from /usr/local/lib/gcc-lib/i686-pc-cygwin/3.1/specs Configured with: ../gcc-3.1/configure --enable-threads=win32 Thread model: win32 gcc version 3.1 // ... junk elided here ... GNU CPP version 3.1 (cpplib) (80386, BSD syntax) GNU C++ version 3.1 (i686-pc-cygwin) compiled by GNU C version 3.1. GccBug2.cpp: In instantiation of `Struct::templatedMemberFunction(const T&) [with T = int]::LocalClass::NestedClass': GccBug2.cpp:6: instantiated from `Struct::templatedMemberFunction(const T&) [with T = int]::LocalClass' GccBug2.cpp:16: instantiated from `void Struct::templatedMemberFunction (const T&) [with T = int]' GccBug2.cpp:23: instantiated from here GccBug2.cpp:7: Internal compiler error in tsubst_decl, at cp/pt.c:5733 Please submit a full bug report, with preprocessed source if appropriate. See for instructions. //========= Source File GccBug2.cpp Begins Here =========== struct Struct { template void templatedMemberFunction(const T&) { class LocalClass { struct NestedClass { void funct(); }; NestedClass nestedClassInstance_; public: void memberFunction() {nestedClassInstance_.funct();} }; LocalClass localClass; localClass.memberFunction(); }; }; void globalFunction() { Struct classInstance; classInstance.templatedMemberFunction(42); } //========= Source File GccBug2.cpp Ends Here ============= >How-To-Repeat: Invoke the compiler on GccBug2.cpp. >Fix: >Release-Note: >Audit-Trail: >Unformatted: