IBM Support

IV97600: 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

  • ****************************************************************
    * USERS AFFECTED: Users who use std::rel_ops operators with    *
    *                 the reverse_allocator type.                  *
    ****************************************************************
    * PROBLEM DESCRIPTION: 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.                               *
    ****************************************************************
    * RECOMMENDATION: Apply the provided PTF.                      *
    *                                                              *
    ****************************************************************
    .
    

Problem conclusion

  • Apply service provided.
    

Temporary fix

Comments

APAR Information

  • APAR number

    IV97600

  • Reported component name

    XL C FOR AIX

  • Reported component ID

    5725C7100

  • Reported release

    D10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2017-06-29

  • Closed date

    2017-06-29

  • Last modified date

    2017-06-29

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

    PI79959

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

Modules/Macros

  •    CELHEXEP CELHNEW  CELHSCPP CELQEXEP CELQNEW
    CELQSCPP CEL4EXEP CEL4NEW  CRTEC128 CRTEC64  CRTE128N CRTIB043
    CRTIT013
    

Fix information

  • Fixed component name

    XL C FOR AIX

  • Fixed component ID

    5725C7100

Applicable component levels

[{"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSGH2K","label":"XL C for AIX"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"13.1","Edition":"","Line of Business":{"code":"LOB73","label":"Power TPS"}}]

Document Information

Modified date:
19 August 2024