IBM Support

LI77622: ERROR IN ACCESS CHECKING IN A LOCAL CLASS

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • The compiler fails to compile the following test case:
    
    ====Compile Command:
    xlC -c test.cpp
    
    ====Test case:
    $ cat test.cpp
    typedef unsigned int            uint32_t;
    
    namespace DataAccess
    {
        class SavepointImpl;
        class RegisteredOperationsJob
        {
        public:
            RegisteredOperationsJob(
                SavepointImpl& owner)
                : m_Owner(owner)
            {
            }
            virtual void run();
    
        private:
            SavepointImpl& m_Owner;
        };
    };
    
    
    namespace DataAccess
    {
    
        class SavepointImpl
        {
        public:
            SavepointImpl();
            ~SavepointImpl();
    
        private:
            friend class RegisteredOperationsJob;
    
    // Insert here "public:" as workaround
            uint32_t m_RemoteOperationJobActive;
        };
    }
    
    
    using namespace DataAccess;
    
    // Overrides from Job:
    void RegisteredOperationsJob::run()
    {
        class RemoteOperationsJobActiveScope
        {
        public:
            RemoteOperationsJobActiveScope(SavepointImpl& owner)
                : m_Owner(owner)
            {
                uint32_t ttt = m_Owner.m_RemoteOperationJobActive;
            }
        private:
            SavepointImpl& m_Owner;
        };
    }
    
    =====Actual Output:
    $ xlC -c test.cpp
    "test.cpp", line 50.35: 1540-0300 (S) The "private" member
    "DataAccess::SavepointImpl::m_RemoteOperationJobActive" cannot
    be accessed.
    
    =====Expected Output:
    Clean compile.
    

Local fix

  • Insert "public:" where shown in the previous example.
    

Problem summary

  • USERS AFFECTED:
    The problem is specific to access checking from members of a
    local class.
    
    PROBLEM DESCRIPTION:
    Access checking may flag an error when a member function of a
    local class accesses a private member even if there is a valid
    friend.
    

Problem conclusion

  • The problem has been resolved and the compiler no longer issues
    an error message for the test case included in this APAR.
    

Temporary fix

Comments

APAR Information

  • APAR number

    LI77622

  • Reported component name

    XL C/C++ FOR LI

  • Reported component ID

    5725C7300

  • Reported release

    C10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2013-10-28

  • Closed date

    2013-10-28

  • Last modified date

    2013-10-28

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

    IV38103

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

Fix information

  • Fixed component name

    XL C/C++ FOR LI

  • Fixed component ID

    5725C7300

Applicable component levels

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSXVZZ","label":"XL C\/C++ for Linux"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"12.1","Line of Business":{"code":"LOB57","label":"Power"}}]

Document Information

Modified date:
14 October 2021