Fixes are available
XL C/C++ for AIX Fix Pack 8 (March 2014 PTF) for 12.1
XL C/C++ for AIX Fix Pack 11 (February 2015 PTF) for 12.1
XL C/C++ for AIX Fix Pack 12 (May 2015 PTF) for 12.1
XL C/C++ for AIX Fix Pack 13 (August 2015 Update) for 12.1
XL C/C++ for AIX Fix Pack 14 (December 2015 Update) for 12.1
XL C/C++ for AIX Fix Pack 15 (April 2016 Update) for 12.1
XL C/C++ for AIX Fix Pack 16 (July 2016 Update) for 12.1
XL C/C++ for AIX Fix Pack 17 (November 2016 Update) for 12.1
XL C/C++ for AIX Fix Pack 18 (February 2017 Update) for 12.1
XL C/C++ for AIX Fix Pack 19 (August 2017 Update) for 12.1
XL C/C++ for AIX Fix Pack 20 (March 2018 Update) for 12.1
XL C/C++ for AIX Fix Pack 9 (July 2014 PTF) for 12.1
XL C/C++ for AIX Fix Pack 10 (October 2014 PTF) for 12.1
XL C/C++ for AIX Fix Pack 21 (January 2019 Update) for 12.1
APAR status
Closed as program error.
Error description
When compiling the following testcase, the compiler issues an error related to the number of arguments for a specific function when it should not. ===== COMPILE COMMAND: xlC -c b.cpp ===== TESTCASE: $ cat b.cpp typedef unsigned long size_t; typedef unsigned long _Bit_type; enum { _S_word_bit = int(8 * sizeof(_Bit_type)) }; struct _Bit_iterator_base {}; struct _Bit_iterator : public _Bit_iterator_base { }; template<class _Alloc> struct _Bvector_base { typedef typename _Alloc::template rebind<_Bit_type>::other _Bit_alloc_type; struct _Bvector_impl : public _Bit_alloc_type { _Bit_iterator _M_start; _Bit_iterator _M_finish; _Bit_type* _M_end_of_storage; _Bvector_impl(const _Bit_alloc_type& __a) ; }; typedef _Alloc allocator_type; _Bvector_base(const allocator_type& __a) ; _Bvector_impl _M_impl; _Bit_type* _M_allocate(size_t __n) { return _M_impl.allocate((__n + int(_S_word_bit) - 1) / int(_S_word_bit)); } }; template <typename T> struct Allocator { typedef size_t size_type; typedef T * pointer; Allocator(); template <typename U> struct rebind { typedef Allocator<U> other; }; pointer allocate( size_type n, const void* hint = 0); }; void tester(size_t a) { Allocator<bool> alloc; _Bvector_base<Allocator<bool> > x(alloc); x._M_allocate(a); } $ ===== ACTUAL OUTPUT: $ xlC b.cpp -c "b.cpp", line 43.31: 1540-0215 (S) The wrong number of arguments has been specified for "Allocator<unsigned long>::allocate(size_type, const void *)". "b.cpp", line 41.18: 1540-0700 (I) The previous message was produced while processing "_Bvector_base<Allocator<bool> >::_M_allocate(size_t)". "b.cpp", line 73.5: 1540-0700 (I) The previous message was produced while processing "tester(size_t)". $ ===== EXPECTED OUTPUT: Clean compile
Local fix
Workaround by specifying the default argument in the call < { return _M_impl.allocate((__n + int(_S_word_bit) - 1) / int(_S_word_bit)); } --- > { return _M_impl.allocate((__n + int(_S_word_bit) - 1) / int(_S_word_bit),0); }
Problem summary
USERS AFFECTED: The problem may be seen when using a default argument from an inline member function of a template class. If there is a call to a function with a default, that call uses the default and the function with the default is after the call. The compile may not pick up the default argument in specific cases. PROBLEM DESCRIPTION: The compiler missed picking up a default argument.
Problem conclusion
The compiler has been fixed to pick up the default argument.
Temporary fix
Comments
APAR Information
APAR number
IV56821
Reported component name
XL C/C++ FOR AI
Reported component ID
5725C7200
Reported release
C10
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt
Submitted date
2014-03-18
Closed date
2014-03-18
Last modified date
2014-03-19
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
Document Information
Modified date:
03 October 2021