IBM Support

IV81793: TEMPLATE ERROR WITH OPERATOR-> OVERLOAD

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • An invalid unexpected template error is output when processing
    template code that uses overloaded operator->.
    
    
    
       === TEST CASE ===
    
    struct d1;
    
    struct Type
    {
        typedef d1 it;
        template<typename T> const T test() const;
    };
    
    struct d2
    {
        typedef struct Type Ref;
        typedef struct Type * Point;
        struct proxy   {
          explicit proxy(Ref const & x) : m_ref(x) {}
          Ref* operator->() ;
          operator Ref*() ;
          Ref m_ref;
        };
        typedef proxy result;
        static result apply(Ref const & x)  {
            return result(x);
        }
    };
    
    struct d1
    {
        typedef d2 d2_;
        typedef d2_::result pointer;
        pointer operator->() const;
    };
    
    int main(int argc, char **argv)
    {
        return Type::it()->test<int>();
    }
    
    
    $ xlC test.cpp
    "test.cpp", line 34.32: 1540-0157 (S) The text ">" is
    unexpected.  It may be that this token was intended as a
    template argument list terminator but the name is not known to
    be a template.
    $
    

Local fix

Problem summary

  • PROBLEM DESCRIPTION:
    Name lookup only found one operator-> but the return type also
    has its own overloaded operator-> .
    
    USERS AFFECTED:
    The problem is specific to overloaded operator-> , where
    lhs->rhs and lhs has non-pointer type and rhs is a template id.
    

Problem conclusion

  • The problem has been fixed.
    

Temporary fix

Comments

APAR Information

  • APAR number

    IV81793

  • Reported component name

    XL C/C++ FOR AI

  • Reported component ID

    5725C7200

  • Reported release

    D10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2016-02-24

  • Closed date

    2016-02-24

  • Last modified date

    2016-02-24

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

    IV78684

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

Fix information

  • Fixed component name

    XL C/C++ FOR AI

  • Fixed component ID

    5725C7200

Applicable component levels

  • RD10 PSY

       UP

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

Document Information

Modified date:
01 October 2021