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]

egcs failures


Hi,
I had a few failures in egcs (I've checked it for
egcs-2.91.57 (egcs-1.1 release) and egcs-2.91.60 (egcs-1.1.1 release).

The first example leads to a crash (SIGSEGV) (unlike g++ 2.8)
// Compilation of the code below with egcs fails with the following
// internal error:
// g++: Internal compiler error: program cc1plus got fatal signal 11
//
// Fails both for egcs-2.91.57 19980901 (egcs-1.1 release)
// and egcs-2.91.60 19981201 (egcs-1.1.1 release)
//
// g++ 2.8 works fine.

template <class T>
struct X { typedef int Y; };

template<class T>
class Z : public X<T> {
   struct W { Y y; };
};

// This code is compiled fine
//
// struct X { typedef int Y; };
//
// class Z : public X {
//    struct W { Y y; };
// };
//
// This code is compiled fine too
//
// template <class T>
// struct X { typedef int Y; };
//
// template<class T>
// class Z : public X<T> {
//    struct W { X<T>::Y y; };
// };

The second example returns an internal compiler error instead of
error classification.
// This program causes the following internal error:
//   fail2.cpp:29: Internal compiler error.
//   fail2.cpp:29: Please submit a full bug report to `egcs-bugs@cygnus.com'.
// Egcs version: egcs-2.91.57 19980901 (egcs-1.1 release).
// Also fails for egcs-2.91.60 19981201 (egcs-1.1.1 release).
// If no inheritance from X<T1> is used,
// the wrong line (marked in the code) is detected properly.

template <class T1>
struct X {};
   
template<class T1>
class Y : public X<T1> {
public:
   template<class T2>
   static void f1(const T2 &);
   static void f2();
};

template<class T1>
template<class T2>	// Bad line
void Y<T1>::f2()
{
   f1(0);
}
   
template<class T1>
template<class T2>
void Y<T1>::f1(const T2 &x)
{}
		       


		Sincerely yours,
			Lev Finkelstein.



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