IBM Support

LI76232: TEMPLATE ASSIGNMENT OPERATOR CALLS ITSELF

Subscribe

You can track all active APARs for this component.

APAR status

  • Closed as program error.

Error description

  • template assignment operator calls itself recursively in the
    example below leading to segfault at runtime.
    
    
    ///////////////////// test.cpp //////////////////////
    
    template<typename First> struct Base
    {
      template<typename OtherFirst>
      First& operator=(const Base<OtherFirst>& other) { }
    
    inline First& operator=(const Base& other) {
       return operator=<First>(other); }
    };
    
    int main()
    {
     Base<int> a;
     a = Base<int>();
     return 0;
    }
    
    ////////////////// end of test.cpp //////////////////////
    
    $xlC test.cpp
    $./a.out
    Segmentation fault (core dumped)
    

Local fix

  • N/A
    

Problem summary

  • Assignment operator call with explicit template args may invoke
    incorrect function
    

Problem conclusion

  • The problem is isolated to the FE and a fix has been dropped.
    

Temporary fix

Comments

APAR Information

  • APAR number

    LI76232

  • Reported component name

    XL C/C++ SLES10

  • Reported component ID

    5724U8300

  • Reported release

    A10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2011-06-10

  • Closed date

    2011-06-10

  • Last modified date

    2011-06-10

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

    LI75770

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

Fix information

  • Fixed component name

    XL C/C++ SLES10

  • Fixed component ID

    5724U8300

Applicable component levels



Document information

More support for: XL C/C++

Software version: A.1

Reference #: LI76232

Modified date: 10 June 2011