From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7457 invoked by alias); 10 Oct 2002 21:36: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 7437 invoked by uid 71); 10 Oct 2002 21:36:01 -0000 Date: Thu, 10 Oct 2002 14:36:00 -0000 Message-ID: <20021010213601.7436.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Reichelt Subject: Re: c++/8143: g++ gives an ice Reply-To: Reichelt X-SW-Source: 2002-10/txt/msg00424.txt.bz2 List-Id: The following reply was made to PR c++/8143; it has been noted by GNATS. From: Reichelt To: ruggero@wam.umd.edu, gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org Cc: Subject: Re: c++/8143: g++ gives an ice Date: Fri, 11 Oct 2002 00:24:14 +0200 Hi, the parser chokes on the following illegal code snippet (X is undefined): ---------------------------snip here--------------------------- struct foo { X x; foo(X) {} foo(X y, int) : x() {} }; ---------------------------snip here--------------------------- The error messages with gcc 3.1 are: bug.cc:3: 'X' is used as a type, but is not defined as a type. bug.cc:5: parse error before `)' token bug.cc:5: missing ';' before right brace bug.cc:6: `X' was not declared in this scope bug.cc:6: parse error before `,' token bug.cc:6: ISO C++ forbids defining types within return type bug.cc:6: semicolon missing after declaration of `struct foo' bug.cc: In function `int foo(...)': bug.cc:6: only constructors take base initializers bug.cc:6: confused by earlier errors, bailing out Gcc 2.95.x and 3.0.x handle the situation gracefully. Gcc 3.1 and 3.2 produce "confused by earlier errors, bailing out" and the main trunk ICEs (checked on i686-pc-linux-gnu and mips-sgi-irix6.5). Greetings, Volker Reichelt http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8143