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 1.1.2 internal error with templates


With the following simple program I get an internal compiler error:

#include <iostream>

template<class T> class Grid
{
 public:
  static const int ROWS = 3;
  static const int COLUMNS = 3;
};

template<class T>class Grid2 : public Grid<T>
{
 public:
  Grid2( const T [Grid2<T>::ROWS][Grid2<T>::COLUMNS], int x ) {};
  void setRows( const int val = ROWS ) { rows = val; }
  int getRows(void) { return( rows ); }
 private:
  int rows;
};

int main(void)
{
  double x[3][3];
  Grid2<double> test(x, 7);
  test.setRows();
  cout << test.getRows() << endl;

  return(0);
}

g++ template.C
template.C:13: Internal compiler error.
template.C:13: Please submit a full bug report to `egcs-bugs@egcs.cygnus.com'.
template.C:13: See <URL:http://egcs.cygnus.com/faq.html#bugreport> for details.
chris@leibniz> g++ -v --save-temps template.C
Reading specs from /usr/local/egcs/lib/gcc-lib/sparc-sun-solaris2.7/egcs-2.91.66/specs
gcc version egcs-2.91.66 19990314 (egcs-1.1.2 release)
 /usr/local/egcs/lib/gcc-lib/sparc-sun-solaris2.7/egcs-2.91.66/cpp -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -D__GNUC_MINOR__=91 -Dsparc -Dsun -Dunix -D__svr4__ -D__SVR4 -D__sparc__ -D__sun__ -D__unix__ -D__svr4__ -D__SVR4 -D__sparc -D__sun -D__unix -Asystem(unix) -Asystem(svr4) -D__EXCEPTIONS -D__GCC_NEW_VARARGS__ -Acpu(sparc) -Amachine(sparc) template.C template.ii
GNU CPP version egcs-2.91.66 19990314 (egcs-1.1.2 release) (sparc)
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/egcs/include/g++
 /usr/local/include
 /usr/local/egcs/sparc-sun-solaris2.7/include
 /usr/local/egcs/lib/gcc-lib/sparc-sun-solaris2.7/egcs-2.91.66/include
 /usr/include
End of search list.
 /usr/local/egcs/lib/gcc-lib/sparc-sun-solaris2.7/egcs-2.91.66/cc1plus template.ii -quiet -dumpbase template.cc -version -o template.s
GNU C++ version egcs-2.91.66 19990314 (egcs-1.1.2 release) (sparc-sun-solaris2.7) compiled by GNU C version 2.95 19990728 (release).
template.C:13: Internal compiler error.
template.C:13: Please submit a full bug report to `egcs-bugs@egcs.cygnus.com'.
template.C:13: See <URL:http://egcs.cygnus.com/faq.html#bugreport> for details.

-- 
Chris McKay     mailto:chris.mckay@solipsys.com
Solipsys Corporation  http://www.solipsys.com
 
Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]