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]

Bug with template statements ?


Using g++ (2.95.2) on Linux paraski23 2.2.13-SMP #1 SMP Fri Feb 18 16:22:38 CET 2000 i686 unknown (output of uname -a)

command used : g++ simple.cxx

David

-- 
David Margery <><   (David.Margery@irisa.fr)
PhD student at Irisa, Rennes, France
Reading specs from /usr/lib/gcc-lib/i386-linux/2.95.2/specs
gcc version 2.95.2 20000313 (Debian GNU/Linux)
 /usr/lib/gcc-lib/i386-linux/2.95.2/cpp -lang-c++ -v -D__GNUC__=2 -D__GNUG__=2 -D__GNUC_MINOR__=95 -D__cplusplus -D__ELF__ -Dunix -D__i386__ -Dlinux -D__ELF__ -D__unix__ -D__i386__ -D__linux__ -D__unix -D__linux -Asystem(posix) -D__EXCEPTIONS -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__ simple.cxx simple.ii
GNU CPP version 2.95.2 20000313 (Debian GNU/Linux) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc-lib/i386-linux/2.95.2/../../../../include/g++-3
 /usr/local/include
 /usr/lib/gcc-lib/i386-linux/2.95.2/include
 /usr/include
End of search list.
The following default directories have been omitted from the search path:
 /usr/lib/gcc-lib/i386-linux/2.95.2/../../../../i386-linux/include
End of omitted list.
 /usr/lib/gcc-lib/i386-linux/2.95.2/cc1plus simple.ii -quiet -dumpbase simple.cc -version -o simple.s
GNU C++ version 2.95.2 20000313 (Debian GNU/Linux) (i386-linux) compiled by GNU C version 2.95.2 20000313 (Debian GNU/Linux).
simple.cxx: In instantiation of `B<A1>':
simple.cxx:39:   instantiated from here
simple.cxx:39: Internal compiler error.
simple.cxx:39: Please submit a full bug report.
simple.cxx:39: See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
# 1 "simple.cxx"
template <class T> class A1 {
public:
   A1() {};
   virtual ~A1() {};
   template <class other> A1 & operator=(const A1<other> o) {
      i=o.i;
   };
   T i;
};
template <class T> class A2 {
public:
   A2() {};
   virtual ~A2() {};
   template <class other> A2 & operator=(const A2<other> o) {
      i=o.i;
   };
   T i;
   T j;
};

template <template <class U> class T> class B {
public:
   B(){};
   virtual ~B(){};
   template <template <class U2> class O> struct rebind { typedef B<O> other ;};
   template <template <class U2> class O> B & operator=(const B<O> o) {
      i=o.i;
   };
   T<int> i;
};


int main(int argc, char argv[]) {
    
   A1<int> a1;
   A1<long> a2;
   a1=a2;
    
   B<A1 > b1;
   B<A2 > b2;
   b1=b2;

   return 0;
}

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