This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
C++ bug
- To: egcs at cygnus dot com, gcc2 at cygnus dot com
- Subject: C++ bug
- From: Marc Lehmann <pcg at goof dot com>
- Date: Mon, 27 Oct 1997 20:24:26 +0100 (CET)
This c++ fragment:
class someclass {
private:
int status;
public:
int f() { return (__extension__ ({ union { __typeof(status) __in; int __i; } __u; \
__u.__in = (status); __u.__i; })); };
};
gives me the following error:
x.c: In method nt someclass::f()':
x.c:6: member 'status' is a private member of class 'someclass'
unfortunately, this is not *entirely* correct ;) The nasty thing is that the
above fragment is fairly common (at least on my machine), since the wait.h
macros are defined using gcc's __extension__. Removing the __extension__
makes it compile clean.
-----==-
----==-- _
---==---(_)__ __ ____ __ Marc Lehmann
--==---/ / _ \/ // /\ \/ / pcg@goof.com
-=====/_/_//_/\_,_/ /_/\_\
The choice of a GNU generation