IBM Support

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

A fix is available

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

    PI79959

  • Reported component name

    C/C++ FOR MVS

  • Reported component ID

    56551210A

  • Reported release

    7A0

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2017-04-13

  • Closed date

    2017-05-29

  • Last modified date

    2017-07-05

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

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

    UI46658 IV95454 IV97600 PI86263

Modules/Macros

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

Fix information

  • Fixed component name

    ANSI C++ CLASS

  • Fixed component ID

    568819807

Applicable component levels

  • R7A0 PSN UI46658

       UP17/06/08 P F706

Fix is available

  • Select the PTF appropriate for your component level. You will be required to sign in. Distribution on physical media is not available in all countries.



Document information

More support for: z/OS family

Software version: 7A0

Reference #: PI79959

Modified date: 05 July 2017