Fixes are available
XL C/C++ for Linux Fix Pack 8 (October 2015 Update) for 12.1
XL C/C++ for Linux Fix Pack 4 (October 2013 Update) for 12.1
XL C/C++ for Linux Fix Pack 5 (December 2013 Update) for 12.1
XL C/C++ for Linux Fix Pack 6 (February 2014 Update) for 12.1
XL C/C++ for Linux Fix Pack 7 (May 2014 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
LI77602
Reported component name
XL C/C++ FOR LI
Reported component ID
5725C7300
Reported release
C10
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt
Submitted date
2013-10-25
Closed date
2013-10-28
Last modified date
2013-10-28
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
5725C7300
Applicable component levels
RC10 PSY
UP
[{"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":"12.1","Line of Business":{"code":"LOB57","label":"Power"}}]
Document Information
Modified date:
14 October 2021