Here is bug report.
Alex
//#########################################################
//------------------- C++ code : BEGIN -------------------
#include <iostream>
//##############
template <typename T1, typename T2 >
class X_two { void f(); };
template <typename T1, typename T2 >
void X_two<T1,T2>::f() {};
//------------------------
// Specializations
template <typename T1>
class X_two<T1,int> { void f(); };
template <class T1> void X_two<T1,int>::f ();
//------------------------
template <typename T1>
void X_two<T1,int>::f() {};
//#####################
//------------------------------------------------------------
//------------------------------------------------------------
int main()
{
return 0;
};
//------------------- C++ code : END ----------------------
//#########################################################
//------------------- Compilation Results : BEGIN ---------
g++ -Wall -v tttu.C
Reading specs from
/tools/EGCS/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.91.57/specs
gcc version egcs-2.91.57 19980901 (egcs-1.1 release)
/tools/EGCS/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.91.57/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 -Wall -D__GCC_NEW_VARARGS__ -Acpu(sparc)
-Amachine(sparc) tttu.C /var/tmp/ccrBEtib.ii
GNU CPP version egcs-2.91.57 19980901 (egcs-1.1 release) (sparc)
#include "..." search starts here:
#include <...> search starts here:
/tools/EGCS/include/g++
/tools/EGCS/sparc-sun-solaris2.6/include
/tools/EGCS/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.91.57/include
/usr/include
End of search list.
/tools/EGCS/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.91.57/cc1plus
/var/tmp/ccrBEtib.ii -quiet -dumpbase tttu.cc -Wall -version -o
/var/tmp/ccavamsr.s
GNU C++ version egcs-2.91.57 19980901 (egcs-1.1 release)
(sparc-sun-solaris2.6) compiled by GNU C version egcs-2.91.57 19980901
(egcs-1.1 release).
tttu.C:21: Internal compiler error 892.
tttu.C:21: Please submit a full bug report to `egcs...@cygnus.com'.
//------------------- Compilation Results : END -----------
//#########################################################
//------------------- Compiler & System ------------------
g++ -v : gcc version egcs-2.91.57 19980901
(egcs-1.1 release)
uname -a : SunOS <nodename> 5.6 Generic_105181-09
sun4m sparc SUNW,SPARCstation-5
//---------------------------------------------------------
//#########################################################
I can reproduce your problem with
gcc version egcs-2.91.66 Debian GNU/Linux (egcs-1.1.2 release)
but no longer with
gcc version egcs-2.93.21 19990502 (gcc2 ss-980929 experimental). The latter
gives some warnings, and an error about your code (line numbers are slightly
off):
foo.cc:8: warning: all member functions in class `X_two<T1,T2>' are private
foo.cc:17: warning: all member functions in class `X_two<T1,int>' are
private
foo.cc:23: prototype for `void X_two<T1,int>::f()' does not match any in
class `X_two<T1,int>'
foo.cc:19: candidate is: void X_two<T1,int>::f<T1>()
foo.cc: In method `void X_two<T1,int>::f()':
foo.cc:23: template definition of non-template `void X_two<T1,int>::f()'
Thus, your problem will most likely be fixed in the next version of EGCS.
HTH,
Ray
--
Obsig: developing a new sig