IV31954: ERROR INITIALIZING STATIC TYPEDEF CONSTEXPR VARIABLE

Subscribe

You can track all active APARs for this component.

APAR status

  • Closed as suggestion for future release.

Error description

  • Test case gives error if using constexpr with typedef compiled
    with -qlanglvl=extended0x
    
    t.cpp
    class test_class
    {
    public:
        static const char test5 = 5;
        static constexpr char test6 = 6;
        typedef char value_type;
        static const value_type test9 = '9';
        static constexpr value_type testA = 'A';  //<----this
    reports error!
    };
    
    xlC const.cpp -qlanglvl=extended0x -c
    "constexpr.cpp", line 8.33: 1540-1127 (S) Only static data
    members with const integral or const enumeration type can
    specify an initializer in the class definition.
    

Local fix

  • N/A
    

Problem summary

Problem conclusion

Temporary fix

Comments

  • In C++11 mode, static constexpr members cannot be
    initialized if the type is a typedef. constexpr feature in
    C++11 is a partial implementation in V12.1 and it can not be
    relied on. The issue is fixed in the next compiler release as
    part of the C++11 support.
    

APAR Information

  • APAR number

    IV31954

  • Reported component name

    XL C/C++ FOR AI

  • Reported component ID

    5725C7200

  • Reported release

    C10

  • Status

    CLOSED SUG

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2012-11-13

  • Closed date

    2013-04-01

  • Last modified date

    2013-04-01

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

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

Fix information

Applicable component levels



Rate this page:

(0 users)Average rating

Add comments

Document information


More support for:

XL C/C++ for AIX
Compiler

Software version:

12.1

Reference #:

IV31954

Modified date:

2013-04-01

Translate my page

Machine Translation

Content navigation