IBM Support

IV73047: MULTI-DIMENSIONAL ARRAY CONST NOT REMOVED

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • A simple template specialization is used to strip the const
    qualification from a given type.  When a const-qualified
    multi-dimensional array is used, the const qualification is not
    removed.
    
    
       === TEST CASE ===
    
    #include <iostream>
    
    template <typename T>
    struct remove_const { typedef T type; };
    
    template <typename T>
    struct remove_const <T const> { typedef T type; };
    
    
    template <typename T>
    struct test
    {
        void operator()() { std::cout << "not const qualified\n"; }
    };
    
    template <typename T>
    struct test<T const>
    {
        void operator()() { std::cout << "const qualified\n"; }
    };
    
    
    int main()
    {
        std::cout << "const int[4][2]: ";
        test<remove_const<const int[4][2]>::type>()();
    }
    
    
    
    $ xlC apar.cpp
    $ ./a.out
    const int[4][2]: const qualified
    $
    

Local fix

Problem summary

  • PROBLEM DESCRIPTION:
    The compiler component that removes const did not consider all
    array dimensions.
    
    USERS AFFECTED:
    Users with problems removing const on template parameters with
    multi-dimensional arrays.
    

Problem conclusion

  • The problem has been fixed.
    

Temporary fix

Comments

APAR Information

  • APAR number

    IV73047

  • Reported component name

    XL C/C++ FOR AI

  • Reported component ID

    5725C7200

  • Reported release

    C10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2015-05-07

  • Closed date

    2015-08-20

  • Last modified date

    2015-08-20

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

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

    IV75537 LI79723

Fix information

  • Fixed component name

    XL C/C++ FOR AI

  • Fixed component ID

    5725C7200

Applicable component levels

  • RC10 PSY

       UP

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

Document Information

Modified date:
14 September 2021