[Bug c++/10964] Problem with initialization of reference to pointer
ehrhardt@mathematik.uni-ulm.de
gcc-bugzilla@gcc.gnu.org
Mon May 26 12:01:00 GMT 2003
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10964
ehrhardt@mathematik.uni-ulm.de changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
------- Additional Comments From ehrhardt@mathematik.uni-ulm.de 2003-05-26 11:07 -------
B1class.ptr is initialized by the constructor as a reference to the
parameter p of the constructor. This invokes undefined behaviour because
the life time of the reference exceeds that of the referenced storage
unit.
class B1class
{
B1class( const void * const p ) : pntr(p) {}
const void * const & pntr;
};
regards Christian
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
More information about the Gcc-bugs
mailing list