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]

template related(?) internal g++ error


Hi!

Here's a g++ bug report. I don't know the options used when configuring/
building gcc (I use the packages gcc.rpm and gpp.rpm from the SuSE
distribution). Hope this helps anyway.

Regards,
Christoph Strebin


 >gcc -v
Reading specs from /usr/lib/gcc-lib/i486-suse-linux/2.95.2/specs
gcc version 2.95.2 19991024 (release)

---------------------

 >g++ -Wall -save-temps bug.cpp
bug.cpp: In function `int main()':
bug.cpp:22: Internal compiler error.
bug.cpp:22: Please submit a full bug report.
bug.cpp:22: See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.

---------------------

 >cat *.i*
# 1 "bug.cpp"
template<class C> class Position {
   C x_, y_, z_;

public:
   Position<C>();
   Position<C>(C x, C y, C z = 0);

   template<class R> template<class A, class B>
   friend Position<R> operator+ (const Position<A>&, const Position<B>&);
};

template<class R> template<class A, class B>
Position<R> operator+ (const Position<A>&, const Position<B>&) {
   return Position<R>(a.x() + b.x(), a.y() + b.y(), a.z() + b.z());
}

int main() {
   unsigned int c = 2;
   int i = -3;
   Position<unsigned int> pc(c,c);
   Position<int> pi(i,i);
   Position<int> ps = operator+<int>(pc + pi);
   return 0;
}

---------------------

 >rpm -qi gcc gpp
...
Name        : gcc                          Relocations: (not relocateable)
Version     : 2.95.2                            Vendor: SuSE GmbH, Nuernberg, Germany
Release     : 149                           Build Date: Fre 19 Jan 2001 07:09:01 CET
Install date: Mon 12 Feb 2001 13:59:26 CET      Build Host: bosch.suse.de
Group       : Development                   Source RPM: gcc-2.95.2-149.src.rpm
Size        : 3552878                          License: GPL
Packager    : feedback@suse.de
...
Name        : gpp                          Relocations: (not relocateable)
Version     : 2.95.2                            Vendor: SuSE GmbH, Nuernberg, Germany
Release     : 149                           Build Date: Fre 19 Jan 2001 07:09:01 CET
Install date: Mon 12 Feb 2001 13:59:30 CET      Build Host: bosch.suse.de
Group       : Development                   Source RPM: gcc-2.95.2-149.src.rpm
Size        : 2502219                          License: GPL
Packager    : feedback@suse.de
...


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