Fixes are available
October 2009 Update for XL C/C++ for Linux, V10.1
June 2011 Update for XL C/C++ for Linux, V10.1
XL C/C++ for Linux Fix Pack 8 (January 2014 Update) for 10.1
August 2010 Update for XL C/C++ for Linux, V10.1
January 2011 Update for XL C/C++ for Linux, V10.1
January 2012 Update for XL C/C++ for Linux, V10.1
July 2012 Update for XL C/C++ for Linux, V10.1
APAR status
Closed as program error.
Error description
===== TESTCASE: ===Start of t.cpp===== typedef const int TypeCI; struct X { static const int a = 1; static TypeCI b = 2; // this should be OK static const TypeCI c = 2; }; int main(){ return 0; } ====End of t.cpp===== ===== ACTUAL OUTPUT: $xlC -c t.cpp "t.cpp", line 5.17: 1540-1127 (S) Only static data members with const integral or const enumeration type can specify an initializer in the class definition. ===== EXPECTED OUTPUT: Should not produce error message.
Local fix
n/a
Problem summary
Users who want to initialize a static class datamemberin the definition of that class will also need to use the 'const' keyword. The defect was that if the 'const' was "hidden" inside a typedef, the compiler did not properly detect the 'const'. The compiler was only checking the top level cv-qualifiers to attempt to determine whether or not 'const' was specified. If the 'const' appeared nested within a typedef, the compiler assumed the 'const' was missing, and emitted an error message.
Problem conclusion
The compiler was modified to recursively examine any typedefs in the datamember initialization if 'const' could not be found at the top level.
Temporary fix
Comments
APAR Information
APAR number
LI75079
Reported component name
XL C/C++ SLES10
Reported component ID
5724U8300
Reported release
A10
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt
Submitted date
2009-12-01
Closed date
2009-12-01
Last modified date
2009-12-01
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/C++ SLES10
Fixed component ID
5724U8300
Applicable component levels
RA10 PSN IZ42811
UP06/09/13
[{"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Product":{"code":"SSJT9L","label":"XL C\/C++"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"A.1","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}}]
Document Information
Modified date:
14 October 2021