IBM Support

PI81632: CLASS INCORRECTLY IDENTIFIED AS ABSTRACT CLASS

A fix is available

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • Code containing an abstract class with pure virtual functions
    has a child class implementing all virtual functions, however
    XLC erroneously identifies the child class and it's implemented
    functions as abstract.
    
    
    
       === TEST CASE ===
    struct  Base{
      virtual void* a(long s, char* e) = 0;
      virtual void* b(long s) = 0;
      virtual void  c(void* ptr) = 0;
      virtual char* d() const = 0;
      virtual ~Base(){ }
    };
    
    template <const char * ID>
    struct Child : public Base
    {
      void * a(long s, char * e) { return 0; }
      void * b(long s) { return 0; }
      void   c(void * ptr) {}
      char * d() const { return (char *) ID; }
    
      static Child<ID>& get()
      {
        static Child<ID> instance;
        return instance;
      }
    };
    
    extern const char ex[7];
    template class Child<ex>;
    
    
    
    $ xlC -c -qlanglvl=extended0x apar.cpp
    "./apar.cpp", line 19.22: CCN6117 (S) "instance" cannot use the
    abstract class "Child" as the type of an object, parameter type,
    or return type.
    "./apar.cpp", line 2.17: CCN6112 (I) "Base::a(long, char *)" is
    a pure virtual function.
    "./apar.cpp", line 3.17: CCN6112 (I) "Base::b(long)" is a pure
    virtual function.
    "./apar.cpp", line 4.17: CCN6112 (I) "Base::c(void *)" is a pure
    virtual function.
    "./apar.cpp", line 5.17: CCN6112 (I) "Base::d() const" is a pure
    virtual function.
    CCN0793(I) Compilation failed for file ./apar.cpp.  Object file
    not created.
    FSUM8226 make: Error code 12
    $
    

Local fix

  • N/A
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED: XLC Users of -qtmplparse=error or            *
    *                 -qlanglvl=extended0x who have a              *
    *                 template class derived from an abstract      *
    *                 base class may see errors indicating that    *
    *                 virtual functions were not overridden.       *
    ****************************************************************
    * PROBLEM DESCRIPTION: Additional diagnostic checking in       *
    *                      template definitions with certain       *
    *                      options exposed an invalid diagnostic   *
    *                      check in a template definition where    *
    *                      virtual function overrides did not      *
    *                      have the optional virtual keyword       *
    *                      specified.                              *
    ****************************************************************
    .
    

Problem conclusion

  • Apply service provided.
    

Temporary fix

Comments

APAR Information

  • APAR number

    PI81632

  • Reported component name

    C/C++ FOR MVS

  • Reported component ID

    56551210A

  • Reported release

    7A0

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2017-05-16

  • Closed date

    2017-05-24

  • Last modified date

    2017-07-06

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

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

    PI84090 IV99661 PI95836

Modules/Macros

  • CCNECICS CCNECWI  CCNED220 CCNEDSCT CCNEDWRT CCNEFILT CCNEHIFC
    CCNEMDEP CCNEOPTP CCNEP    CCNEPP   CCNETBY  CCNMSGE  CCNMSGT
    

Fix information

  • Fixed component name

    C/C++ FOR MVS

  • Fixed component ID

    56551210A

Applicable component levels

  • R7A0 PSY UI46641

       UP17/06/08 P F706

Fix is available

  • Select the PTF appropriate for your component level. You will be required to sign in. Distribution on physical media is not available in all countries.

[{"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Product":{"code":"SG19M","label":"APARs - z\/OS environment"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"7A0","Edition":"","Line of Business":{"code":"","label":""}},{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSQKCWV","label":"IBM C\/C++ for MVS\/ESA"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"7A0","Edition":"","Line of Business":{"code":"LOB35","label":"Mainframe SW"}}]

Document Information

Modified date:
09 August 2024