IBM Support

PK86630: QUALIFIER NOT DEFINED IN THE CURRENT SCOPE

A fix is available

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • The following test cases generate error messages about "the
    qualifier ... is not defined in the current scope" with the V1r9
    and V1R10 compilers.
    
    
    ====TEST CASE 1
    
    // small testcase 1
    
    // 3770
    template <class Node>
    struct redblack_tree
    {
       // 3774
       typedef Node node_type;
    
       // 3787 error
       void DeleteNode( const unsigned& key ) { delete
    RemoveNode(key); }
    
       // 3790
       node_type* RemoveNode( const unsigned& key );
    
    };
    
    // 4282
    struct FreeBlock
    {
       // 4286
       void operator delete( void* );
    
    };
    
    int main(void)
    {
       redblack_tree<FreeBlock> test;
       test.DeleteNode(1);
       return 0;
    }
    
    This should compile clean but gets:
    
    "b.cpp", line 11.45: 1540-0129 (S) The qualifier "FreeBlock" is
    not defined in the current scope.
    "b.cpp", line 11.9: 1540-0700 (I) The previous message was
    produced while processing
    "redblack_tree<FreeBlock>::DeleteNode(const unsigned int &)".
    "b.cpp", line 29.8: 1540-0700 (I) The previous message was
    produced while processing "main()".
    
    
    ==== TEST CASE 2
    
    
    // small testcase 2
    
    // 4010
    template<class T, class Parent>
    struct double_linked_list_element : public Parent
    {
    
        // 4021
        virtual ~double_linked_list_element()
        {
           // 4024
           Remove();
        }
        // 4064
        void Remove(void) {  }
    
    };
    
    // 4152
    struct CBIBClientBase
    {
    //   void* operator new( size_t size ) ; //{ return
    malloc(size); }
       void operator delete( void* p ) ;// { free(p); }
    //   void* operator new[] ( size_t size ) ;//{ return
    malloc(size); }
       void operator delete[] ( void* p );// { free(p); }
    };
    
    
    // 4168
    struct CBIBClientBasePMT : public CBIBClientBase
    {
    //   void* operator new[] ( size_t );
    };
    
    int main(void)
    {
       double_linked_list_element<int,CBIBClientBasePMT> test;
       return 0;
    }
    
    
    This should compile clean but gets
    
    "c.cpp", line 13.5: 1540-0129 (S) The qualifier "CBIBClientBase"
    is not defined in the current scope.
    "c.cpp", line 9.13: 1540-0700 (I) The previous message was
    produced while processing
    "double_linked_list_element<int,CBIBClientBasePMT>::~double_link
    ed_list_element()".
    "c.cpp", line 5.8: 1540-0700 (I) The previous message was
    produced while processing "struct
    double_linked_list_element<int,CBIBClientBasePMT>".
    "c.cpp", line 35.5: 1540-0700 (I) The previous message was
    produced while processing "main()".
    

Local fix

  • Move the clase defining operator delete above the class calling
    it.
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED: The problem happens when a user-defined      *
    *                 operator delete is called in a template for  *
    *                 a class that is dependent on the template    *
    *                 parameter.                                   *
    ****************************************************************
    * PROBLEM DESCRIPTION: The compiler is attempting to resolve   *
    *                      the qualified name of the call to       *
    *                      operator delete at the reference        *
    *                      location instead of the                 *
    *                      instantiation point.                    *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    WORKAROUND:
    The user could work around the problem by moving the
    user-defined operator delete or the class with such
    an operator above the definition of the template
    calling it.
    EXPECTED ERROR:
    The user would see an error complaining that a
    qualifier is undefined or not complete. Likely there
    is no obvious use of this qualifier at the location
    specified in the error.
    

Problem conclusion

  • The compiler is no longer using the wrong location.
    

Temporary fix

Comments

APAR Information

  • APAR number

    PK86630

  • Reported component name

    C/C++ FOR MVS

  • Reported component ID

    56551210A

  • Reported release

    750

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2009-05-14

  • Closed date

    2009-05-14

  • Last modified date

    2009-07-01

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

    PK82205

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

    UK46621

Modules/Macros

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

Fix information

  • Fixed component name

    C/C++ FOR MVS

  • Fixed component ID

    56551210A

Applicable component levels

  • R750 PSY UK46621

       UP09/06/11 P F906

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":"750","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":"750","Edition":"","Line of Business":{"code":"LOB35","label":"Mainframe SW"}}]

Document Information

Modified date:
09 August 2024