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]

971225 :: Internal compiler error 892.


albatros:~/bug/bug2> egcs_g++ -v
Reading specs from
/usr/local/egcs/lib/gcc-lib/i386-unknown-freebsd3.0/egcs-2.91.03/specs
gcc version egcs-2.91.03 971225 (gcc-2.8.0)

albatros:~/bug/bug2> egcs_g++ -o bug bug.cc
bug.cc:21: Internal compiler error 892.
bug.cc:21: Please submit a full bug report to `egcs-bugs@cygnus.com'.

albatros:~/bug/bug2> cat bug.cc
#include <iostream.h>
#include <typeinfo>

template <typename T>
class A {
public:
  void test ();
};

template <typename T>
void
A<T>::test(){
  cerr << "test for " << typeid(*this).name() << endl;
}
// Specialization declaration
void
A<double>::test();

// Specialization definition
void
A<double>::test(){  // ============= LINE 21 ==================
  cerr << "specialization for " << typeid(*this).name() << endl;
}

int
main(){
  A<int> ai;
  A<double> ad;
  ai.test();
  ad.test();
  return 0;
}

	The program is trying to declare a specialization for test() and then
define the actual specialization. 

-- 
         Ovidiu


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