IBM Support

LI79723: 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

    LI79723

  • Reported component name

    XL C/C++ FOR BG

  • Reported component ID

    5799AG100

  • Reported release

    C10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2017-09-22

  • Closed date

    2017-09-22

  • Last modified date

    2017-09-22

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

    IV73047

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

Fix information

  • Fixed component name

    XL C/C++ FOR BG

  • Fixed component ID

    5799AG100

Applicable component levels

[{"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SS2LWA","label":"XL C\/C++ for Blue Gene\/Q"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"12.1","Edition":"","Line of Business":{"code":"LOB73","label":"Power TPS"}}]

Document Information

Modified date:
05 September 2024