This is the mail archive of the gcc@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]

Re: gcc 3.0 and C++


On Fri, Jul 20, 2001 at 11:59:05AM +0100, Rob Taylor wrote:

>>> Trying to compile my program on gcc 3.0, have this error:

>>> language.cpp:285: no matching function for call to `Data::Data(Data)'
>>> data.h:13: candidates are: Data::Data(Data&)

>> looks like your trying to pass a temporary into a non-const
>> reference. thats a BAD THING. modify the constructor of
>> Language to take a const reference or use pass-by-copy.
I've changed Data instead - made all Data constructors to take
const as parameter. It works [tends to]. But I can't do any
real development with gcc 3.0, it's too slow, unfortunately.

> hmm. looks like <hurried a bit>. Language's ctor is pass-by
> copy... hmmm ... looking at it a bit longer, this does seem a
> bit weird - why on earth would gcc be trying to create a
> *second* temporary Data object????
It confused me too, and that's the reason why I've posted it
here instead of looking for workarounds.

So, can anyone say for sure that it IS a bug, or can we just
forget it since it works??


-- 
The goal of Computer Science is to build something that will last at
least until we've finished building it.


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