The information in this article applies to:
SYMPTOMSVisual C++ incorrectly allows a pointer to be passed to a function that takes a non-const reference to a pointer to a const. This breaks C++ type safety and allows the const data assigned to the reference to be modified by the pointer after the function has returned. RESOLUTIONTo protect the const data, the reference should be a reference to a const pointer to a const, that is: const char * const &. STATUSThis bug was corrected in Microsoft Visual C++, version 6.0. MORE INFORMATION
A reference may only be initialized with an lvalue expression of the same
type or a class derived from that type. If this is not the case, the
reference must be declared const.
Sample Code
Additional query words: 8.0c 8.00c 9.0 9.00 10.00 10.10 10.20
Keywords : kbVC150bug kbVC152bug kbVC200bug kbVC210bug kbVC400bug kbVC410bug kbVC420bug kbVC500bug kbVC600fix |
Last Reviewed: April 8, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |