This is the mail archive of the gcc-bugs@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]

gcc gives bogus errors for classes wrapped in 'extern "C"'


gcc-2.95.2 gives bogus errors for classes wrapped in 'extern "C"'
(I'm not even sure whether this is legal.)

extern "C" {
   class Argh {
       public:
          ~Argh ();
           void DoSomething (Argh *);
           Argh ();
   };
}

gcc will give the error
    "invalid use of undefined type `class Argh'"
when it sees the "Argh *" parameter of DoSomething ().

(It's even weirder in that these error messages are only given for
methods which occur AFTER the destructor has been seen; i.e., moving 
the destructor so it's the LAST method above will result in a clean
compile.  <fx:Theme music from _The Twilight Zone_> Hmmm. </fx>)

Any ideas/suggestions, or is this simply a case of "Doctor, it hurts
when I do this."  -- "Well, don't do that."?

Thanks!

--turly

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