IV38103: 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

    IV38103

  • Reported component name

    XL C/C++ FOR AI

  • Reported component ID

    5725C7200

  • Reported release

    C10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2013-03-15

  • Closed date

    2013-06-17

  • Last modified date

    2013-06-17

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

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

    LI77403 LI77622

Fix information

  • Fixed component name

    XL C/C++ FOR AI

  • Fixed component ID

    5725C7200

Applicable component levels

  • RC10 PSY U860073

       UP C



Rate this page:

(0 users)Average rating

Document information


More support for:

XL C/C++ for AIX
Compiler

Software version:

12.1

Reference #:

IV38103

Modified date:

2013-06-17

Translate my page

Machine Translation

Content navigation