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 bug in gcc 2.95 and 2.95.1?



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


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