Article View: gnu.g++.bug
Article #849Re: g++ 2.2.2 bug with extern "C" friends
From: Mike Stump
Date: Sat, 29 Aug 1992 17:05
Date: Sat, 29 Aug 1992 17:05
55 lines
2468 bytes
2468 bytes
This problem should not exist in the next release of gcc.
Here is a patch in the mean time:
*** cp-class.c.~1~ Sat Aug 29 04:07:47 1992
--- cp-class.c Sat Aug 29 09:56:46 1992
*************** finish_struct (t, list_of_fieldlists, em
*** 2581,2587 ****
if (! fields) fields = x;
DECL_FIELD_CONTEXT (x) = t;
! DECL_CLASS_CONTEXT (x) = t;
DECL_FIELD_SIZE (x) = 0;
/* We set DECL_BIT_FIELD tentatively in grokbitfield.
--- 2581,2589 ----
if (! fields) fields = x;
DECL_FIELD_CONTEXT (x) = t;
! /* We could be making an extern "C" function a friend. */
! if (DECL_LANG_SPECIFIC (x))
! DECL_CLASS_CONTEXT (x) = t;
DECL_FIELD_SIZE (x) = 0;
/* We set DECL_BIT_FIELD tentatively in grokbitfield.
> Date: Tue, 25 Aug 1992 12:15:51 +0100
> From: Steve Rumsby <steve@maths.warwick.ac.uk>
> Message-Id: <11787.199208251115@amazon>
> To: bug-g++@prep.ai.mit.edu
> Organization: Maths Institute, Warwick University, Coventry, UK.
> This seems to have got lost (I haven't seen it in gnu.g++.bug) so I'm
> resending it. If some people see it twice, sorry.
> ------
> Classes with extern "C" friend functions seem to give cc1plus
> gastric distress. This happens on Sparc (SunOS 4.1.1), Sun 3 (SunOS
> 4.1.1), and SGI MIPS (Irix 4.0.1) boxes, so I guess it is pretty
> fundamental! Any suggestions?
> $ cat kb.c
> extern "C" int bar();
> struct foo {
> friend int bar();
> };
> $ g++ -v kb.c
> Reading specs from /gnu/lib/gcc-lib/sparc-sunos4/2.2.2/specs
> gcc version 2.2.2
> /gnu/lib/gcc-lib/sparc-sunos4/2.2.2/cpp -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -Dsparc -Dsun -Dunix -D__sparc__ -D__sun__ -D__unix__ -D__sparc -D__sun -D__unix kb.c /usr/tmp/cca00897.i
> GNU CPP version 2.2.2 (sparc)
> /gnu/lib/gcc-lib/sparc-sunos4/2.2.2/cc1plus /usr/tmp/cca00897.i -quiet -dumpbase kb.cc -version -o /usr/tmp/cca00897.s
> GNU C++ version 2.2.2 (sparc) compiled by GNU C version 2.2.2.
> /gnu/bin/gcc: Internal compiler error: program cc1plus got fatal signal 11
Technical Details
Message-ID:
<9208291705.AA00823@cygnus.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!cygnus.com!mrsShow Full Headers
Complete Article Headers
Newsgroups: gnu.g++.bug Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!cygnus.com!mrs From: mrs@cygnus.com (Mike Stump) Subject: Re: g++ 2.2.2 bug with extern "C" friends Message-ID: <9208291705.AA00823@cygnus.com> Sender: gnulists@ai.mit.edu Organization: GNUs Not Usenet Distribution: gnu Date: Sat, 29 Aug 1992 17:05:28 GMT Approved: bug-g++@prep.ai.mit.edu Lines: 56