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]

C++ bug?


Hi Alexandre,

 I'm using gcc 2.95 on a Sun Ultra Sparc (Solaris 2.6)
machine. I think I found a bug in gcc and I've tried to
report it to the corresponding mailing list. However, my
mail server has some problem with its configuration and the
mailing list server is bouncing all mails I submit. I would
like to send you the message that I was posting. Please,
could you post it for me?

 Here it goes. Thanks in advance,

	Alex

PS: I've also sent it to law@cygnus.com with no success (?).


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Hi,

 I installed the last version of gcc/egcs and had problems
in compiling part of my package that compiled perfectly with
egcs-1.1.2. I'm working in a Sun UltraSparc under Solaris
2.6. By the way, it seems to me that this version compiles
much faster than egcs, :-).

 I attach a tar file that contains a small C++ class and its
makefile in which the "bug" shows up. The main problem
appears in instantiating a template friend function of the
class (two "-" operators). Which makes this really strange
is that in the same class th operator "+", with parallel C++
syntaxis, is declared and does not give any problems. This,
together with the fact that under egcs 1.1.2 the same code
did not have problems makes me thing that there is some bug
in the compiler itself. Can somebody help me with this?

 The output of my make is:
g++ -c ColorRGBA.cc -I.
ColorRGBA.h: In instantiation of `ColorRGBA<float>':
ColorRGBA.cc:6:   instantiated from here
ColorRGBA.h:221: invalid use of undefined type `class ColorRGBA<float>'
ColorRGBA.h:297: forward declaration of `class ColorRGBA<float>'
ColorRGBA.h:213: invalid use of undefined type `class ColorRGBA<float>'
ColorRGBA.h:297: forward declaration of `class ColorRGBA<float>'
ColorRGBA.h: In instantiation of `ColorRGBA<unsigned char>':
ColorRGBA.cc:7:   instantiated from here
ColorRGBA.h:221: invalid use of undefined type `class ColorRGBA<unsigned char>'
ColorRGBA.h:297: forward declaration of `class ColorRGBA<unsigned char>'
ColorRGBA.h:213: invalid use of undefined type `class ColorRGBA<unsigned char>'
ColorRGBA.h:297: forward declaration of `class ColorRGBA<unsigned char>'
ColorRGBA.h: In instantiation of `ColorRGBA<short unsigned int>':
ColorRGBA.cc:8:   instantiated from here
ColorRGBA.h:221: invalid use of undefined type `class ColorRGBA<short unsigned int>'
ColorRGBA.h:297: forward declaration of `class ColorRGBA<short unsigned int>'
ColorRGBA.h:213: invalid use of undefined type `class ColorRGBA<short unsigned int>'
ColorRGBA.h:297: forward declaration of `class ColorRGBA<short unsigned int>'
ColorRGBA.h: In instantiation of `ColorRGBA<unsigned int>':
ColorRGBA.cc:9:   instantiated from here
ColorRGBA.h:221: invalid use of undefined type `class ColorRGBA<unsigned int>'
ColorRGBA.h:297: forward declaration of `class ColorRGBA<unsigned int>'
ColorRGBA.h:213: invalid use of undefined type `class ColorRGBA<unsigned int>'
ColorRGBA.h:297: forward declaration of `class ColorRGBA<unsigned int>'
ColorRGBA.h: In instantiation of `ColorRGBA<short int>':
ColorRGBA.cc:10:   instantiated from here
ColorRGBA.h:221: invalid use of undefined type `class ColorRGBA<short int>'
ColorRGBA.h:297: forward declaration of `class ColorRGBA<short int>'
ColorRGBA.h:213: invalid use of undefined type `class ColorRGBA<short int>'
ColorRGBA.h:297: forward declaration of `class ColorRGBA<short int>'
ColorRGBA.h: In instantiation of `ColorRGBA<int>':
ColorRGBA.cc:11:   instantiated from here
ColorRGBA.h:221: invalid use of undefined type `class ColorRGBA<int>'
ColorRGBA.h:297: forward declaration of `class ColorRGBA<int>'
ColorRGBA.h:213: invalid use of undefined type `class ColorRGBA<int>'
ColorRGBA.h:297: forward declaration of `class ColorRGBA<int>'
make: *** [all] Error 1

ColorRGBA.tgz


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