Re: could not convert `obj(5)' to `obj &'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jon Vance wrote:

I have a bunch of code that used to compile under an older version of gcc, and will not do so using 2.96. Here is a very simple example of the problem I am having:

void printit(obj& o)
void printit (obj const & o)
{
 printf("%d\n", o.i);
}

g++     t.cpp   -o t
t.cpp: In function `int main ()':
t.cpp:17: could not convert `obj(5)' to `obj &'
t.cpp:11: in passing argument 1 of `printit (obj &)'
make: *** [t] Error 1
you cannot bind a temporary to a non-constant reference

nathan


-- Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC The voices in my head said this was stupid too nathan@xxxxxxxxxxxxxxxx :: http://www.planetfall.pwp.blueyonder.co.uk



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux