This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: gcc 3.0 and C++
- To: gcc at gcc dot gnu dot org
- Subject: Re: gcc 3.0 and C++
- From: Bohdan Vlasyuk <bohdan at kivc dot vstu dot vinnica dot ua>
- Date: Fri, 20 Jul 2001 13:59:46 +0300
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.