IBM Support

IV69603: DECLTYPE ERROR WITH OVERLOADED OPERATOR

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • The compiler is outputting an invalid error when using C++11
    decltype with an overloaded operator.
    
    
       === TEST CASE ===
    
    template <typename T>
    T&& myDeclVal();
    
    template <typename F>
    struct MyTDeclType
    {
     typedef decltype(myDeclVal<F>()()) type;
    };
    
    class FuncObj
    {
     public:
      int operator()();
    };
    
    int main()
    {
     // WORKS
     typedef decltype(myDeclVal<FuncObj>() ()) t1;
    
     // DOES NOT WORK
     typedef MyTDeclType<FuncObj ()>::type t2;
    }
    
    
    $ xlC -c -qlanglvl=extended0x apar.cpp
    "test.cpp", line 7.40: 1540-2442 (S) This expression cannot be
    used as a decltype expression.
    "test.cpp", line 22.17: 1540-0700 (I) The previous message was
    produced while processing "struct MyTDeclType<FuncObj ()>".
    "test.cpp", line 16.5: 1540-0700 (I) The previous message was
    produced while processing "main()".
    $
    

Local fix

  • NA
    

Problem summary

  • PROBLEM DESCRIPTION:
    Invalid error with C++11 decltype.
    
    USERS AFFECTED:
    Users with decltype in a struct.
    

Problem conclusion

  • Fix was implemented.
    

Temporary fix

Comments

APAR Information

  • APAR number

    IV69603

  • Reported component name

    XL C/C++ FOR AI

  • Reported component ID

    5725C7200

  • Reported release

    D10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2015-02-18

  • Closed date

    2015-04-29

  • Last modified date

    2015-04-29

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

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

Fix information

  • Fixed component name

    XL C/C++ FOR AI

  • Fixed component ID

    5725C7200

Applicable component levels

  • RD10 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":"13.1"}]

Document Information

Modified date:
03 October 2021