APAR status
Closed as program error.
Error description
When a const-qualified version of a typeid is present in the same function as the non-const version of the same object, the typeid of the non-const version is incorrectly reported as const. === TEST CASE === #include <typeinfo> #include <stdio.h> class test { }; const std::type_info &func() { typeid(const test *); return typeid(test); } int main() { printf("%s\n",func().name()); printf("%s\n",typeid(const test *).name()); } OUTPUT: K4test PK4test EXPECTED OUTPUT: 4test PK4test The typeinfo symbols in the object file are missing the non-const 'typeinfo name' string: [68] m 0x20000b94 .data 1 unamex typeinfo for test [74] m 0x20000ba0 .data 1 unamex typeinfo for test const* [159] m 0x20000ab0 .data 1 weak typeinfo for test [161] m 0x20000ab8 .data 1 weak typeinfo name for test const [163] m 0x20000ac0 .data 1 weak typeinfo for test const* [165] m 0x20000ad0 .data 1 weak typeinfo name for test const*
Local fix
Problem summary
PROBLEM DESCRIPTION: The typeid of an unqualified type may be exchanged with a typeid of the type with cv-qualification. USERS AFFECTED: C++ users using typeid on pointers to const/volatile qualified types. Problem occurs at run time.
Problem conclusion
The compiler now generates type info using only the unqualified variant.
Temporary fix
Comments
APAR Information
APAR number
LI80944
Reported component name
XL C/C++ LINUX
Reported component ID
5725C7310
Reported release
G11
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt / Xsystem
Submitted date
2019-08-15
Closed date
2019-08-19
Last modified date
2019-08-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++ LINUX
Fixed component ID
5725C7310
Applicable component levels
[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSXVZZ","label":"XL C\/C++ for Linux"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"G11","Edition":"","Line of Business":{"code":"LOB57","label":"Power"}}]
Document Information
Modified date:
19 August 2019