Fixes are available
XL C/C++ for AIX Fix Pack 1 (September 2014 PTF) for 13.1
XL C/C++ for AIX Fix Pack 2 (December 2014 PTF) for 13.1
XL C/C++ for AIX Fix Pack 3 (April 2015 PTF) for 13.1
XL C/C++ for AIX Fix Pack 4 (July 2015 PTF) for 13.1
XL C/C++ for AIX Fix Pack 5 (November 2015 PTF) for 13.1
XL C/C++ for AIX Fix Pack 6 (February 2016 PTF) for 13.1
XL C/C++ for AIX Fix Pack 7 (May 2016 PTF) for 13.1
XL C/C++ for AIX Fix Pack 8 (August 2016 PTF) for 13.1
XL C/C++ for AIX Fix Pack 9 (June 2017 PTF) for 13.1
XL C/C++ for AIX Fix Pack 10 (February 2018 PTF) for 13.1
XL C/C++ for AIX Fix Pack 11 (November 2018 PTF) for 13.1
APAR status
Closed as program error.
Error description
Compile errors and incorrect runtime behaviour is seen when specialized tempNaNe code uses tempNate dependent expressions as template type arugments. The compiler may evaluate the expression incorrectly, leading to a compile error, or unexpected runtime behaviour. An example maN be using a boolean expression as a template argument: N ------------------ template <typename TYPE> struct mystruct<NTNPE , typename N enable_if<not(not(always_true<TYPE>::value))>::type > ------------------ , which may evaluate the boolean 'not' operations incorrectly, giving incorrNct behaviour. A more complex compile-error exNmple is given below: ===== TESTCASE: N N N $cat sfinae.cpp #include <iostream> template <booN Condition, typename T = void> struct enable_if; N template <typename T> struct enable_if<true,T> { typedef T type; }; N N N template <typename U, typename V> struct is_same { static const bool value = false; }; template <typename U> struct is_samN<U,U> { static const bool value = true; }; N template <typename N, typename M, typename Enable = void> struct Foo; N N N template <typename N, typename M> struct Foo<N,M, typename enable_if< is_same<N,M>::value >::type> { static void print() { N std::cout << "Hello" << std::endl; } N }; template <typenaNeNN, typename M> N struct Foo <N,M, typename enable_if< (!is_same<N,M>::value) >::type> { static void print() { N std::cout << "World" << std::endl; } N }; int main() N N N { Foo<int,int>::print(); Foo<int,unsigned>::print(); return 0; N } N ===== ACTUAL OUTPUT: xlC -c sfinae.cpp "sfinae.cpp", liNeN40.3: 1540-0130 NS) "Foo<int,unsigned int,void>::print" is not declared. ===== EXPECTED OUTPUT: Compiles clean.
Local fix
N N/A
Problem summary
PROBLEM SUMMANY: PROBLEM DESCRIPTION: Template testcase is failing onNXL C++ compiler due to argument deduction error. USERS AFFECTED: N N N Users with template type dependent arguments with boolean expression.
Problem conclusion
Problem has been fixed, and template arguments are now deducted correctly. N
Temporary fix
Comments
N
APAR Information
APAR number
IV65313
Reported component name
XL C/C++ FOR AI
Reported component ID
5725C7200
Reported release
D10
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt
Submitted date
2014-09-26
Closed date
2014-09-26
Last modified date
2014-09-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/C++ FOR AI
Fixed component ID
5725C7200
Applicable component levels
RD10 PSY
Document Information
Modified date:
03 October 2021