IBM Support

IZ76854: FAILING MATCH FOR OPERATOR==

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • When compiling the following test case, an invalid error is
    occurring, and compilation ends.
    
    
       ======  TEST CASE  ======
    
    struct a {};
    
    #include <set>
    typedef std::set<a> a_set;
    
    bool reverse_cmp(const a_set::const_reverse_iterator lhs,
                     const a_set::reverse_iterator rhs)
    {
        return lhs == rhs;
    }
    
    bool forward_cmp(const a_set::const_iterator lhs,
                     const a_set::iterator rhs)
    {
        return lhs == rhs;
    }
    
       ====== ERROR MESSAGE ======
    "test.C", line 9.16: 1540-0218 (S) The call does not match any
    parameter list for "operator==".
    

Local fix

  • In reverse_cmp, construct a const_reverse_iterator from the
    parameter reverse_iterator "rhs".
    
    
    bool reverse_cmp(const a_set::const_reverse_iterator lhs,
                     const a_set::reverse_iterator rhs)
    {
        const a_set::const_reverse_iterator rhsc (rhs);
    
        return lhs == rhsc;
    }
    

Problem summary

  • PROBLEM DESCRIPTION:
    When compiling source that contains comparisons between
    reverse_iterator with a const_reverse_iterator, a compile time
    error related to operator== is occurring.
    
    USERS AFFECTED:
    Compiler users.
    

Problem conclusion

  • Extra double-parameter template declarations were added to
    allow the comparison of different types of iterators.  The same
    was done for all seven operators (i.e. ==, !=, <, >, <=.>=, and
    - ), being compliant with the C++0x feature.
    
    The fix implemented has the potential to affect
    backwards/forwards binary and source compatibility.  Two
    compiler macros have been created to allow the fix to be
    enabled/disabled:
    
    __IBMCPP_LIB_280_ADD_NEW_OPERATORS: [1] - This macro corrects
    the problem by adding extra code to the existing
    implementation.
    __IBMCPP_LIB_280_REMOVE_COMPAT_03:  [2] - This macro removes
    the old implementation code.  Object files compiled with this
    option will no longer be backward binary compatible.
    
    The fix can be used by including combinations of these two
    macros:
    
    [1] alone:  Fixes the original issue and stays backward binary
    compatible.  The trade-off is that there is some extra code
    included.
    [2] alone:  Not a valid option, as it will remove necessary
    code.
    Both [1,2]:  Fixes the original issue and removes the older
    implementation code, the result being that object files will no
    longer be backwards binary compatible.
    Niether []:  Does not fix the issue, and gives the previous
    behaviour.
    
    You can enable the fix macro via a #define or -D option on the
    compile line, i.e.   #define __IBMCPP_LIB_280_ADD_NEW_OPERATORS
    or -D__IBMCPP_LIB_280_ADD_NEW_OPERATORS
    

Temporary fix

Comments

APAR Information

  • APAR number

    IZ76854

  • Reported component name

    XL C++ AIX

  • Reported component ID

    5724U8100

  • Reported release

    A10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2010-06-03

  • Closed date

    2010-06-03

  • Last modified date

    2010-06-03

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

    IZ69961

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

Fix information

  • Fixed component name

    XL C++ AIX

  • Fixed component ID

    5724U8100

Applicable component levels

[{"Line of Business":{"code":"LOB08","label":"Cognitive Systems"},"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Product":{"code":"SSJT9L","label":"XL C\/C++"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"A.1"}]

Document Information

Modified date:
06 October 2021