This is the mail archive of the gcc-bugs@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]

Internal compiler error 107


EGCS folks,

The program below generates "Internal compiler error 107" under EGCS-1.0.2
g++.  Just a simple "g++ -o foobar foobar.cc" should do the trick.  The
code shown fails on both Linux 2.0.32 and Solaris 5.6 systems using 1.0.2, 
but compiles and runs successfully using 1.0.1 on an Irix 6.2 system.
Enjoy!

Chris Burghart
burghart@ucar.edu


# include <iostream.h>

class JunkStream {};

template <class T>
inline JunkStream& operator<< (JunkStream &js, T &t)
{
    return js;
}

class Foo
{
public:
    Foo( void ) { foo = 2; }
    
    ostream &print (ostream &out)
    {
	int indent = foo * 5;
	char s[indent+1];
	for (int i = 0; i < indent; i++)
	    s[i] = ' ';
	s[indent] = 0;
	out << s << endl;
	return (out);
    }
private:
    int foo;
};

main( int argc, char *argv[])
{
    cout << "Hello, world!\n";
}



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