error 354

Sebastian Krahmer - DI krahmer@cs.uni-potsdam.de
Wed Mar 17 11:21:00 GMT 1999


Hi,

i found a bug in linux-egcs, sorry if it is already known.

<++snip++>

/*** Produces an 'internal compiler error 354' via egcs version 2.90.27.
 *** S. Krahmer <krahmer@cs.uni-potsdam.de>
 ***
 *** egcs -DPRODUCE_ERROR foo.cc -lstdc++
 ***/
#include <iostream.h>

class fault {
   	int errno;
    public:
       	fault(int e) { errno=e; }
        int print() { cout<<errno<<"\n"; }
};

class foo {
   	int i;
    public:
   	foo(int j) 
        {
           	i = j; 
                throw fault(2); 
        }
};


int main()
{
   	foo *f;

    	try {
           	f = new foo(1);
#ifdef PRODUCE_ERROR
        } catch (fault foo::F) {
#else
	} catch (fault F) {
#endif    
           	cout<<"fault:";
           	F.print();
        }
        return 0;
}

<--snip-->

regards,
Sebastian.

; ---- Only 'void main(){}' compiles without warnings. ;-) ---
; S. Krahmer <-> krahmer@cs.uni-potsdam.de	
; http://www.cs.uni-potsdam.de/homepages/students/linuxer






More information about the Gcc-bugs mailing list