This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

C++ bug



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]