Path: utzoo!attcan!uunet!samsung!think!linus!linus!fkuhl From: fkuhl@mitre.org (F. S. Kuhl) Newsgroups: comp.lang.c++ Subject: Bug in Sun C++ ? Summary: Private class members in anonymous unions are accessible Message-ID: <116288@linus.mitre.org> Date: 7 Aug 90 14:45:55 GMT Sender: usenet@linus.mitre.org Reply-To: fkuhl@mitre.org (F. S. Kuhl) Organization: The MITRE Corporation, McLean, VA Lines: 18 I'm using Sun C++ release 2.0. Given a class definition like: class Obj { private: union { char cval; int ival; }; }; I'd expect ival to be inaccessible outside class scope except to friend classes and functions. It's accessible. If I name the union, things work as I expect. Am I missing something? -- Frederick Kuhl fkuhl@mitre.org Civil Systems Division The MITRE Corporation