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-II in GCC



This letter was sended to gcc-bugs@gcc.gnu.org and the newsgroup
fido7.ru.gnu.

Wow! This is the second bug in GCC was discovered last two days when I
tried to compile my program!

  g++ -c test.ii
  i.e. (cc1plus test.ii)
produce
  test.ii: In function `int main()':
  test.ii:20: Internal compiler error.

gcc version 2.95.2 19991024 (release)
configure --prefix=/usr --enable-shared --with-gnu-as --with-gnu-ld --enable
-threads --with-cpu=pentium --enable-cpp --enable-languages=c,c++,objc,java

Linux 2.2.9-ac6 on Pentium 166MMX/32Mb

My experiences with debugger shows that it is SIGSEGV. If I replace
operator[] near the end of the program to function f() all work
properly. If I only change 'i[2]' near the end of the program to
'i.operator[](2)' all work properly.

-----BEGIN test.ii-----
template <class T> struct A {};

template <bool f>
struct B {};

template <class T >
struct D : B<A<T>::x>
{
};

template< template<class T> class U >
struct E
{
  void operator[](int n) { }
};

int main()
{
  E<D> i;
  i[2];
}
-----END test.ii-----





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