IBM Support

LI78440: CONFUSING DIAGNOSTIC ON TEMPLATE MISMATCH

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • When diagnosing a template mismatch error, the compiler outputs
    an error message lacking the template name.  In a large
    application this may be confusing when trying to identify and
    fix the error.
    
    
       === TEST CASE ===
    
    namespace B { class ZZ; }
    namespace A { template <typename T> T test(B::ZZ); }
    namespace C { class ZZ ; }
    namespace A { template <> bool test(C::ZZ) { return false; } }
    
    
    "test.cpp", line 4.32: 1540-1278 (S) The deduced type "bool
    (ZZ)" does not match the specialized type "bool (ZZ)".
    

Local fix

Problem summary

  • PROBLEM DESCRIPTION:
    Confusing template diagnostic message causing difficult error
    debugging.
    
    USERS AFFECTED:
    Users with template mismatch.
    

Problem conclusion

  • A new message is now output that should correctly pinpoint the
    issue in the code.  For the example above, the following
    message is now output:
    
    'apar.cpp', line 4.32: 1540-1286 (S) The specialization does
    not match 'template T A::test(B::ZZ)'.A new message is now
    output that should correctly pinpoint the issue in the code.
    For the example above, the following message is now output:
    
    'apar.cpp', line 4.32: 1540-1286 (S) The specialization does
    not match 'template T A::test(B::ZZ)'.
    

Temporary fix

Comments

APAR Information

  • APAR number

    LI78440

  • Reported component name

    XL C/C++ FOR LI

  • Reported component ID

    5725C7300

  • Reported release

    D10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2015-02-25

  • Closed date

    2015-02-25

  • Last modified date

    2015-02-25

  • APAR is sysrouted FROM one or more of the following:

    IV63660

  • 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

[{"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":"13.1","Line of Business":{"code":"LOB57","label":"Power"}}]

Document Information

Modified date:
17 October 2021