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]

ICE 42 trying to use explicit template-instantiation


I get ICE 42 trying to use explicit template-instantiation.
(I'm not sure if I'm writing legal C++ code)
The 2 examples below generates ICE with egcs-2.92.07.
I include ii-files in the mail.
//Peter

----
//err.cc
int f(int in) { return in+2;}
struct test{
  template <int TR(int)> test(){ }
};
int main() {
  test c=test::test<f>();
  return 0;
}
------------
err.cc: In function `int main()':
err.cc:7: Internal compiler error 42.
err.cc:7: Please submit a full bug report to `egcs-bugs@cygnus.com'.
------------
//err2.cc
struct test{
  template <int I> test(){ }
};
int main() {
  test c=test::test<1>();
  return 0;
}
----------
err2.cc: In function `int main()':
err2.cc:6: Internal compiler error 42.
err2.cc:6: Please submit a full bug report to `egcs-bugs@cygnus.com'.
---
marr:hsv>>g++ -v
Reading specs from
/usr/local/cvap/egcs/egcs-19980914/lib/gcc-lib/mips-sgi-irix6.4/egcs-2.92.07/specs
gcc version egcs-2.92.07 19980914 (gcc2 ss-980609 experimental)

err.ii.gz

err2.ii.gz


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