IBM Support

IZ42531: TYPEDEF FUNCTION SYNTAX CAUSING INTERNAL COMPILER ERROR.

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • typedef function syntax causing Internal Compiler Error.
    This happens when the compiler tries to to compile the line
    "(this->*some_functions [*count++]) ();"
    
    TESTCASE:
    ---------
    class Test
    {
     public:
      void some_function();
      void foo1();
      void foo2();
      void foo3();
    };
    
    void Test::foo1(){}
    void Test::foo2(){}
    void Test::foo3(){}
    
    typedef void (Test::*classfunc) (void);
    
    static classfunc some_functions [] =
    {
     &Test::foo1,
     &Test::foo2,
     &Test::foo3
    };
    
    void Test::some_function()
    {
     int *count;
     (this->*some_functions [*count++]) ();
    }
    
    int main()
    {
     class Test test_class;
     test_class.some_function();
    }
    

Local fix

  • Replace "*count++" with a temp variable, i.e.
    
    void Test::some_function()
    {
     int *count;
     int temp=*count++;
     (this->*some_functions [temp]) ();
    }
    

Problem summary

  • Pointer-to-member function calls with side effects such as
    (p->*a[i++])() causes the compiler to fail by producing
    internal Compiler error.
    

Problem conclusion

  • The side-effects are now processed properly and the
    pointer-to-member function call implemented correctly.
    Install the PTF to get the fix.
    

Temporary fix

Comments

APAR Information

  • APAR number

    IZ42531

  • Reported component name

    XLC C++ AIX

  • Reported component ID

    5724S7100

  • Reported release

    900

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2009-01-26

  • Closed date

    2009-03-19

  • Last modified date

    2009-04-28

Fix information

  • Fixed component name

    XLC C++ AIX

  • Fixed component ID

    5724S7100

Applicable component levels

[{"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Product":{"code":"SSJT9L","label":"XL C\/C++"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"9.0","Edition":"","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}}]

Document Information

Modified date:
28 April 2009