Bug 66 - bogus errors for classes wrapped in 'extern "C"'
Summary: bogus errors for classes wrapped in 'extern "C"'
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 2.95.2
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2000-03-05 10:36 UTC by martin
Modified: 2003-07-25 17:33 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description martin 2000-03-05 10:36:00 UTC
 Original-Message-Id: <200001131843.KAA06379@scv1.apple.com>
 Date: Thu, 13 Jan 2000 18:56:23 +0000

 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

Release:
2.95.2
Comment 1 Martin v. Loewis 2000-03-08 23:38:08 UTC
State-Changed-From-To: open->analyzed
State-Changed-Why: Confirmed as a bug
Comment 2 Martin v. Loewis 2000-03-09 07:38:08 UTC
From: loewis@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org, martin@loewis.home.cs.tu-berlin.de,
  nobody@gcc.gnu.org
Cc:  
Subject: Re: c++/66
Date: 9 Mar 2000 07:38:08 -0000

 Old Synopsis: [not accepted] bogus errors for classes wrapped in 'extern "C"'
 New Synopsis: bogus errors for classes wrapped in 'extern "C"'
 
 State-Changed-From-To: open->analyzed
 State-Changed-By: loewis
 State-Changed-When: Wed Mar  8 23:38:08 2000
 State-Changed-Why:
     Confirmed as a bug  
 
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=66&database=gcc
Comment 3 Neil Booth 2000-12-02 09:59:30 UTC
State-Changed-From-To: analyzed->closed
State-Changed-Why: Fixed in CVS, with testcase extern4.C
Comment 4 Neil Booth 2000-12-02 17:59:30 UTC
From: neil@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org, martin@loewis.home.cs.tu-berlin.de,
  nobody@gcc.gnu.org
Cc:  
Subject: Re: c++/66
Date: 2 Dec 2000 17:59:30 -0000

 Synopsis: bogus errors for classes wrapped in 'extern "C"'
 
 State-Changed-From-To: analyzed->closed
 State-Changed-By: neil
 State-Changed-When: Sat Dec  2 09:59:30 2000
 State-Changed-Why:
     Fixed in CVS, with testcase extern4.C
 
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=66&database=gcc