From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nathan Sidwell To: "Andrew J. Malton" Cc: gcc@gcc.gnu.org Subject: Re: Forward class in throw declaration. Date: Fri, 14 Sep 2001 07:40:00 -0000 Message-id: <3BA21753.240E2200@codesourcery.com> References: <200109141406.KAA28750@plg2.math.uwaterloo.ca> X-SW-Source: 2001-09/msg00546.html "Andrew J. Malton" wrote: > > The following snippet uses a forward class name in a throw declaration: > > class F { > int v; > public: > F (int v) { this-> v = v; } > void raise () throw (F) { throw new F (0); } > }; > > It compiles and works perfectly well using "gcc version egcs-2.91.66 > 19990314/Linux (egcs-1.1.2 release)" and "gcc version 2.95.2 19991024 > (release)" but when compiled with "gcc version 3.0" it fails to parse: > > F.cpp:5: invalid use of undefined type `class F' > F.cpp:1: forward declaration of `class F' > > Is this a bug, or newly correct ;-) behaviour, or am I missing something? newly correct. 15.4/1 nathan -- Dr Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC 'But that's a lie.' - 'Yes it is. What's your point?' nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org