[Bug other/60783] unexpected address variation when taking address of reference, const reference, etc.

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Apr 7 20:40:00 GMT 2014


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60783

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I don't see why this is a bug, g and h should be different.  Here is the
reason, const int* const & cannot lvalue bind to int *, it can lvalue bind to
const int* or int* const.  So there is a lvalue to rvalue and then a conversion
from int * to const int* and then a rvalue to const lvalue reference binding to
const int* const &.  This is true for i, j, and k.

For l, int* const& can be lvalue bind to int*.



More information about the Gcc-bugs mailing list