Fixes are available
January 2012 PTF for XL C/C++ for AIX, V11.1
April 2012 PTF for XL C/C++ for AIX, V11.1
July 2012 PTF for XL C/C++ for AIX, V11.1
October 2012 PTF for XL C/C++ for AIX, V11.1
February 2013 PTF for XL C/C++ for AIX, V11.1
XL C/C++ for AIX Fix Pack 14 (May 2013 PTF) for 11.1
XL C/C++ for AIX Fix Pack 15 (August 2013 PTF) for 11.1
XL C/C++ for AIX Fix Pack 16 (November 2013 PTF) for 11.1
XL C/C++ for AIX Fix Pack 17 (February 2014 PTF) for 11.1
XL C/C++ for AIX Fix Pack 18 (May 2014 PTF) for 11.1
XL C/C++ for AIX Fix Pack 19 (August 2014 PTF) for 11.1
XL C/C++ for AIX Fix Pack 20 (November 2014 PTF) for 11.1
XL C/C++ for AIX Fix Pack 21 (April 2015 PTF) for 11.1
XL C/C++ for AIX Fix Pack 22 (September 2015 PTF) for 11.1
XL C/C++ for AIX Fix Pack 23 (March 2016 PTF) for 11.1
XL C/C++ for AIX Fix Pack 24 (September 2016 PTF) for 11.1
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
IV11128
Reported component name
XL C/C++ AIX
Reported component ID
5724X1300
Reported release
B10
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt
Submitted date
2011-11-22
Closed date
2012-01-09
Last modified date
2012-01-09
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++ AIX
Fixed component ID
5724X1300
Applicable component levels
RB10 PSY U849548
UP C
Document Information
Modified date:
09 January 2012