About cookies on this site Our websites require some cookies to function properly (required). In addition, other cookies may be used with your consent to analyze site usage, improve the user experience and for advertising. For more information, please review your options. By visiting our website, you agree to our processing of information as described in IBM’sprivacy statement. To provide a smooth navigation, your cookie preferences will be shared across the IBM web domains listed here.
Question & Answer
Question
My program fails to compile with an error message indicating that a reference to a non-const object cannot be initialized with an r-value of that object. What is the rationale behind this compiler behavior?
[{"Product":{"code":"SSJT9L","label":"XL C\/C++"},"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Component":"Compiler","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF016","label":"Linux"},{"code":"PF022","label":"OS X"}],"Version":"All Versions","Edition":"","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}},{"Product":{"code":"SSGH3R","label":"XL C\/C++ for AIX"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Component":"Compiler","Platform":[{"code":"PF002","label":"AIX"}],"Version":"All Versions","Edition":"Not applicable","Line of Business":{"code":"LOB73","label":"Power TPS"}},{"Product":{"code":"SSXVZZ","label":"XL C\/C++ for Linux"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Component":"Compiler","Platform":[{"code":"PF016","label":"Linux"}],"Version":"All Versions","Edition":"Not Applicable","Line of Business":{"code":"LOB73","label":"Power TPS"}}]
Log InLog in to view more of this document
This document has the abstract of a technical article that is available to authorized users once you have logged on. Please use Log in button above to access the full document. After log in, if you do not have the right authorization for this document, there will be instructions on what to do next.
Was this topic helpful?
Document Information
More support for:
XL C/C++
Software version:
All Versions
Operating system(s):
AIX, Linux, OS X
Document number:
335179
Modified date:
06 December 2018
UID
swg21153090