IBM Support

LI75504: PRIVATE STRUCT CANNOT BE ACCESSED

Subscribe

You can track all active APARs for this component.

APAR status

  • Closed as program error.

Error description

  • When compiling the code below, the compiler is incorrectly
    outputting the following error message:
    
    
    line 9.21: 1540-0300 (S) The "private" member "struct A::S_"
    cannot be accessed.
    
    
    -------------------------
    class A
    {
    private:
       struct S_ {
         enum SVE { X, Y, Z };
       };
    private:
       template <S_::SVE e>
       double f() const { return 0.0; }
    };
    -------------------------
    

Local fix

Problem summary

  • PROBLEM DESCRIPTION:
    When a template member function has a reference to a data
    member that is private, the access checker fails to recognize
    that these two members are within the same class scope, and
    gives an error.
    
    USERS AFFECTED:
    Users using template member functions to access a private data
    member.
    

Problem conclusion

  • Changed the scope of the template function to be within a class
    scope, so that the access checker can recognize that the
    template function and the reference data are both class
    members.
    

Temporary fix

Comments

APAR Information

  • APAR number

    LI75504

  • Reported component name

    XL C/C++ AE BG/

  • Reported component ID

    5799HJH00

  • Reported release

    900

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2010-09-13

  • Closed date

    2010-09-13

  • Last modified date

    2010-09-13

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

    LI75471

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

Fix information

  • Fixed component name

    XL C/C++ AE BG/

  • Fixed component ID

    5799HJH00

Applicable component levels



Document information

More support for: XL C/C++
Compiler

Software version: 9.0

Reference #: LI75504

Modified date: 13 September 2010


Translate this page: