Fixes are available
November 2009 PTF for XL C/C++ for AIX, V10.1
October 2010 PTF for XL C/C++ for AIX, V10.1
May 2012 PTF for XL C/C++ for AIX, V10.1
January 2013 PTF for XL C/C++ for AIX, V10.1
XL C/C++ for AIX Fix Pack 18 (July 2013 PTF) for 10.1
XL C/C++ for AIX Fix Pack 19 (October 2013 PTF) for 10.1
XL C/C++ for AIX Fix Pack 21 (October 2015 PTF) for 10.1
August 2009 PTF for XL C/C++ for AIX, V10.1
March 2010 PTF for XL C/C++ for AIX, V10.1
April 2010 PTF for XL C/C++ for AIX, V10.1
June 2010 PTF for XL C/C++ for AIX, V10.1
May 2011 PTF for XL C/C++ for AIX, V10.1
October 2011 PTF for XL C/C++ for AIX, V10.1
February 2012 PTF for XL C/C++ for AIX, V10.1
September 2012 PTF for XL C/C++ for AIX, V10.1
XL C/C++ for AIX Fix Pack 20 (October 2014 PTF) for 10.1
APAR status
Closed as program error.
Error description
The compiler is issuing an unexpected error message when using TR1 extensions for the following test case: ===== TESTCASE: $ cat test.cpp #include <memory> int main() { std::tr1::shared_ptr<int const> ptr; if (ptr) {} return 0; } ===== ACTUAL OUTPUT: $xlC test.cpp -D__IBMCPP_TR1__ "/usr/vacpp/include/memory", line 850.34: 1540-0258 (S) A return value of type "void *" cannot be initialized with an expression of type "const int *". "usr/vacpp/include/memory", line 848.9: 1540-0700 (I) The previous message was produced while processing "std::tr1::shared_ptr<const int>::operator void *() const". "test.cpp", line 4.13: 1540-0700 (I) The previous message was produced while processing "main()". ===== EXPECTED OUTPUT: Should compile clean
Local fix
int main(void) { shared_ptr<int const > ptr; // changing this to <int const *> // works fine if (ptr) {} // or changing this to if(&ptr) works fine return 0; }
Problem summary
This problem is specific to tr1::shared_ptr There are cases where an object of this class could not be used in a condition such as if(myptr){}
Problem conclusion
The library class has been updated to allow this.
Temporary fix
Comments
APAR Information
APAR number
IZ55630
Reported component name
XL C++ AIX
Reported component ID
5724U8100
Reported release
A10
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt
Submitted date
2009-07-20
Closed date
2009-08-10
Last modified date
2009-11-26
APAR is sysrouted FROM one or more of the following:
APAR is sysrouted TO one or more of the following:
Fix information
Fixed component name
XL C++ AIX
Fixed component ID
5724U8100
Applicable component levels
Document Information
Modified date:
26 November 2009