From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32418 invoked by alias); 12 Feb 2002 15:46:09 -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 32368 invoked by uid 71); 12 Feb 2002 15:46:05 -0000 Date: Tue, 12 Feb 2002 07:46:00 -0000 Message-ID: <20020212154605.32362.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Reichelt Subject: Re: c++/5665: gcc goes into endless loop on bad code Reply-To: Reichelt X-SW-Source: 2002-02/txt/msg00278.txt.bz2 List-Id: The following reply was made to PR c++/5665; it has been noted by GNATS. From: Reichelt To: gcc-gnats@gcc.gnu.org, bergur@tern.is, gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org Cc: Subject: Re: c++/5665: gcc goes into endless loop on bad code Date: Tue, 12 Feb 2002 17:06:04 +0100 Hi, with gcc 3.1 20020202 (experimental) the code causes an ICE: [deleted lots of error messages] calc/fdps.h:865: parse error before `)' token calc/fdps.h:881: 'db_t' is used as a type, but is not defined as a type. calc/fdps.h:905: syntax error before `<' token calc/fdps.h:905: `MSG' was not declared in this scope calc/fdps.h:905: template argument 1 is invalid calc/fdps.h:905: tree check: expected class 't', have 'x' (error_mark) in make_typename_type, at cp/decl.c:5689 Please submit a full bug report, [etc.] The ICE can be reproduced with the following code snippet: ------------------snip here----------------- template class A { class B { X foo(); }; // illegal, X is undefined }; template X A::B::foo() {} ------------------snip here----------------- Just compile with "g++ -c" to the the following error message: bug.cpp:3: parse error before `)' token bug.cpp:6: syntax error before `<' token bug.cpp:6: `T' was not declared in this scope bug.cpp:6: template argument 1 is invalid bug.cpp:6: tree check: expected class 't', have 'x' (error_mark) in make_typename_type, at cp/decl.c:5689 Please submit a full bug report, [etc.] However, this reduced example compiles fine with gcc 3.0.3, i.e. a correct error message is emitted without ICE. Greetings, Volker Reichelt http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5665