http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51716

             Bug #: 51716
           Summary: access to private member possible
    Classification: Unclassified
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c++
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: k...@et.pl


GCC should generate error here:

class Prv {
private:
  union
  {
    union
    {
      unsigned int Bits;
    };
  };
};

unsigned int getBits(Prv *P) {
  return P->Bits;
}

Reply via email to