This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Template bug in gcc 2.95 and 2.95.1?
- To: gcc-bugs at gcc dot gnu dot org
- Subject: Template bug in gcc 2.95 and 2.95.1?
- From: Radu Cornea <radu at ics dot uci dot edu>
- Date: Fri, 10 Sep 1999 10:29:04 -0700 (PDT)
Hi!
I installed gcc 2.95 over egcs 1.1.2 and now some programs do not compile
well. The error I get is from a portion of code that looks like this:
template<class T>
class Test {
};
class Obj{
};
template class Test <Obj const *>;
template class Test <const Obj *>;
When compiling with egcs 1.1.2, everithing is fine. Using gcc 2.95 or
2.95.1, I get this error:
test.cpp:10: duplicate explicit instantiation of `class Test<const Obj *>'
Exit 1
I also tried the Sun C++ compiler and it gives no error.
Is this a bug of gcc? Those two declarations should be different, from my
opinion, but I am not sure.
I am using gcc 2.95.1 on a Sun UltraSparc 5 with Solaris 2.5.
Thanks,
Radu Cornea.
--
Radu Cornea
Graduate Student
Information & Computer Science
University of California - Irvine
E-mail: radu@ics.uci.edu