Fixes are available
APAR status
Closed as program error.
Error description
The compiler is outputting an error message that it can not find a match for a method in a parent class, when a method with the same name is found in the child class, or vice versa. The error is triggered by one (but not both) of the methods using a 'throw()' exception specifier. ==== TEST CASE === class A1 { public: void test(int) throw(); }; class A2: public A1 { public: using A1::test; void test(int); void func() { test(1); } }; $ xlC -c test.cpp "test.cpp", line 9.19: 1540-0219 (S) The call to "test" has no best match. "test.cpp", line 9.19: 1540-1230 (I) Argument number 1 is the implicit "this" argument. "test.cpp", line 9.24: 1540-1229 (I) Argument number 2 is an rvalue of type "int". "test.cpp", line 3.10: 1540-1202 (I) No candidate is better than "A1::test(int)". "test.cpp", line 9.19: 1540-1231 (I) The conversion from argument number 1 to "A2 &" uses "the identity conversion". "test.cpp", line 9.24: 1540-1231 (I) The conversion from argument number 2 to "int" uses "the identity conversion". "test.cpp", line 8.10: 1540-1202 (I) No candidate is better than "A2::test(int)". "test.cpp", line 9.19: 1540-1231 (I) The conversion from argument number 1 to "A2 &" uses "the identity conversion". "test.cpp", line 9.24: 1540-1231 (I) The conversion from argument number 2 to "int" uses "the identity conversion". $
Local fix
Remove the 'throw()' exception specifier, or add one to the other method, in either the parent or child classes.
Problem summary
PROBLEM DESCRIPTION: The compiler was not able to handle the throw() specifier properly in overload resolution. USERS AFFECTED: Users with the throw() specifier in their class with another function with same name.
Problem conclusion
The compiler can now correctly handle throw specifiers.
Temporary fix
Comments
APAR Information
APAR number
LI77966
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
2014-04-30
Closed date
2014-04-30
Last modified date
2014-04-30
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:
16 October 2021