This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: invalid cast of an rvalue expression
- From: Foster Boondoggle <ocheyette at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Wed, 18 May 2011 07:36:03 -0700 (PDT)
- Subject: Re: invalid cast of an rvalue expression
- References: <23105605.post@talk.nabble.com>
Hi Adam99 - Did you ever get a reply to this? I have the exact same problem
(indeed, with SqMatrix and Matrix, though I had though I wrote the class
many years ago!) I can't seem to get it to compile in any form with the
latest gcc.
Thanks.
Oren
adam99 wrote:
>
>
>
> I am getting a following error on g++ 4.1.2
>
>
> SqMatrix.h: In member function 'SqMatrix SqMatrix::operator*(const
> SqMatrix&) const':
> SqMatrix.h:91: error: invalid cast of an rvalue expression of type
> 'Matrix' to type 'const SqMatrix&'
>
>
> for the following code segment
>
> SqMatrix operator * (const SqMatrix &sm) const {
> return (const SqMatrix &) (*(Matrix *)this * sm); }
>
>
> this error did not seem to appear on g++ 3.4.6. Do you know what could be
> the problem?
>
> Thanks
>
>
>
>
--
View this message in context: http://old.nabble.com/invalid-cast-of-an-rvalue-expression-tp23105605p31647448.html
Sent from the gcc - Help mailing list archive at Nabble.com.