Fixes are available
APAR status
Closed as program error.
Error description
The following test case fails with a compile time error when using -qlanglvl=extended0x: ===== COMPILE COMMAND: xlC -qlanglvl=extended0x test.cpp ===== TESTCASE: $ cat test.cpp struct a { char* v; char* w; }; template<class T> void func(T* v, int& n) { static const a table[] = { {"asdf", "ADFS"} , {"dfs", "dfk"} , {"adfks", 0} }; n = sizeof(table); } int main(int argc, char* argv[]) { int n; func(&n, n); } $ ===== ACTUAL OUTPUT: $xlC -qlanglvl=extended0x test.cpp "test.cpp", line 17.11: 1540-0201 (S) The "sizeof" operator is not allowed for type "const a []". $ ===== EXPECTED OUTPUT: Should compile clean.
Local fix
As a workaround, the test case can be compiled with -qlanglvl=extended0x:novariadictemplates to avoid the error message.
Problem summary
USERS AFFECTED: This would only be seen with -qtmplparse=error|warn or with -qlanglvl=variadictemplates. PROBLEM DESCRIPTION: The compiler produces an invalid error while processing sizeof in a template definition.
Problem conclusion
The compiler has been fixed to avoid producing an invalid error while processing sizeof in a template definition.
Temporary fix
Comments
APAR Information
APAR number
LI76626
Reported component name
XL C/C++ FOR LI
Reported component ID
5724X1400
Reported release
B10
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt / Xsystem
Submitted date
2012-02-06
Closed date
2012-02-06
Last modified date
2012-02-06
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++ FOR LI
Fixed component ID
5724X1400
Applicable component levels
RB10 PSN IV11128
UP06/09/13
[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSXVZZ","label":"XL C\/C++ for Linux"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"B10","Line of Business":{"code":"LOB57","label":"Power"}}]
Document Information
Modified date:
17 October 2021