This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Forward class in throw declaration.


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?

A Malton

--
Dr. Andrew Malton, Associate Professor
Department of Computer Science
University of Waterloo
Waterloo, Canada N2L 3G1

http://www.cs.uwaterloo.ca/~ajmalton
tel: +1 519 888 4567 x 5144
fax: +1 519 885 1208


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]