This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: Fix C++ testsuite failures.


Paolo Bonzini wrote:

> Sure, but the address needs to be passed (at least until inlining) as
> the "this" pointer of C::operator int ().  The wording is misleading,
> but at least at -O0 a warning is correct.

I think the warning is appropriate at all optimization levels.  The
warning is telling the user that they are (implicitly) trying to take
the address of a register variable.  As you say, the warning could be
improved by saying that the address-taken is happening implicitly as
part of a call to C::operator int(), so that the user does not react
with "Huh?!  I didn't say &x!" -- but the fact that we warn seems
entirely appropriate.

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713


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