IBM Support

IV95454: STD::REL_OPS OPERATOR RESOLUTION CONFLICT FOR REVERSE_ITERATOR TYPE

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • A conflict exists during template resolution between template
    operators for the reverse_iterator type.
    
    The reverse_iterator parameter operators defined in <xutility>
    may conflict with the more generic operators in <utility> when
    the std::rel_ops namespace is used:
    
    
    <xutility>
       449  template<class _RIL, class _RIR> inline
       450        bool operator!=(const reverse_iterator<_RIL>&_X,
       451                        const reverse_iterator<_RIR>&_Y)
       452          {return (!(_X == _Y)); }
    
    <utility>
       113  template<class _Ty> inline
       114          bool operator!=(const _Ty& _X, const _Ty& _Y)
       115          {return (!(_X == _Y)); }
    
    
       === TEST CASE ===
    
    #include <utility>
    #include <xutility>
    #include <deque>
    
    class MyElement { int a; };
    
    class MyList
    {
      public:
         std::deque<MyElement>::reverse_iterator end();
    };
    
    using namespace std::rel_ops;
    
    class MyClass
    {
     public:
      MyList list;
      inline bool mytest();
      std::deque<MyElement>::reverse_iterator position;
    };
    
    inline bool MyClass::mytest()
    {
            return(position != list.end());
            //return( std::operator!=(position,list.end()));
    }
    
    bool test()
    {
     MyClass a;
     return a.mytest();
    }
    
    
    
    > xlC -c apar.cpp
    "./apar.cpp", line 25.25: CCN5219 (S) The call to "operator!="
    has no best match.
    
    "./apar.cpp", line 25.16: CCN6228 (I) Argument number 1 is an
    lvalue of type "std::deque<MyElement,std::allocator<MyElement>
    >::reverse_iterator".
    "./apar.cpp", line 25.36: CCN6229 (I) Argument number 2 is an
    rvalue of type
    "std::reverse_iterator<std::deque<MyElement,std::allocator<MyEle
    ment> >::iterator>".
    
    "/usr/include/xutility", line 450.14: CCN6202 (I) No candidate
    is better than "std::operator!=
    <std::deque<MyElement,std::allocator<MyElement>
    >::iterator,std::deque<MyElement,std::allocator<MyElement>
    >::iterator>(const
    reverse_iterator<std::deque<MyElement,std::allocator<MyElement>
    >::iterator> &, const
    reverse_iterator<std::deque<MyElement,std::allocator<MyElement>
    >::iterator> &)".
    "./apar.cpp", line 25.16: CCN6231 (I) The conversion from
    argument number 1 to "const
    std::reverse_iterator<std::deque<MyElement,std::allocator<MyElem
    ent> >::iterator> &" uses "the identity conversion".
    "./apar.cpp", line 25.36: CCN6231 (I) The conversion from
    argument number 2 to "const
    std::reverse_iterator<std::deque<MyElement,std::allocator<MyElem
    ent> >::iterator> &" uses "the identity conversion".
    
    "/usr/include/utility", line 114.14: CCN6202 (I) No candidate is
    better than "std::rel_ops::operator!=
    <std::reverse_iterator<std::deque<MyElement,std::allocator<MyEle
    ment> >::iterator> >(const
    reverse_iterator<std::deque<MyElement,std::allocator<MyElement>
    >::iterator> &, const
    reverse_iterator<std::deque<MyElement,std::allocator<MyElement>
    >::iterator> &)".
    "./apar.cpp", line 25.16: CCN6231 (I) The conversion from
    argument number 1 to "const
    std::reverse_iterator<std::deque<MyElement,std::allocator<MyElem
    ent> >::iterator> &" uses "the identity conversion".
    "./apar.cpp", line 25.36: CCN6231 (I) The conversion from
    argument number 2 to "const
    std::reverse_iterator<std::deque<MyElement,std::allocator<MyElem
    ent> >::iterator> &" uses "the identity conversion".
    
    CCN0793(I) Compilation failed for file ./apar.cpp.  Object file
    not created.
    >
    

Local fix

  • Call the required operator explicitly, as per the example above:
    
       return( std::operator!=(position,list.end()));
    

Problem summary

  • PROBLEM DESCRIPTION:
    The std::rel_ops operators require the same type for both
    parameters.  Specializations of the same reverse_allocator type
    for both parameters are missing in the STL for these operators
    and therefore, applications fail to compile if they are used.
    
    USERS AFFECTED:
    Users who use std::rel_ops operators with the reverse_allocator
    type.
    

Problem conclusion

  • The problem has been fixed.
    

Temporary fix

Comments

APAR Information

  • APAR number

    IV95454

  • Reported component name

    XL C/C++ FOR AI

  • Reported component ID

    5725C7200

  • Reported release

    D13

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2017-04-27

  • Closed date

    2017-04-27

  • Last modified date

    2017-04-27

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

    PI79959

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

Fix information

  • Fixed component name

    XL C/C++ RUNTIM

  • Fixed component ID

    5725C7201

Applicable component levels

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSGH3R","label":"XL C\/C++ for AIX"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"D13","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}}]

Document Information

Modified date:
29 June 2020