🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.bug
Article #172

Re: "Weird" bug in g++-2.2.2

#172
From: Johan Garpendahl
Date: Mon, 27 Jul 1992 08:34
69 lines
2367 bytes
It seems like this already has been fixed. 
Thanks, 
	
	Johan
	

garp@isy.liu.se (Johan Garpendahl) writes:

>Found this bug while compiling InterViews 3.1-beta.
>I don't know if it is a multiple inheritance bug or a bug related to 
>enums in classes, remove the enum and it compiles, remove the multiple
>inheritance and it compiles. At least it won't complain.

>I have g++-2.2.2 on a Sun SS1+ with SunOS 4.1.1
>Happy hunting ...

>	Johan


>Example

>---------------------------8<-----------------------------
>class EnumClass  {
>public:
>    enum { no_break, pre_break, in_break, post_break };
>};

>struct PointerA;

>class Parent1 {
>private:
>    PointerA* p1;
>};

>class  PointerB;

>class Parent2 : public EnumClass   {
>private:
>    PointerB* p1;
>};

>class PointerC  ;

>class Child : public Parent2 , public Parent1 {
>protected:
>    PointerC* p1; // Complain here
>};

>main(){}
>---------------------------8<-----------------------------

>Compile:
>lin(garp)127)> g++ -v tt.cc
>Reading specs from /usr/local/gnu/lib/gcc-lib/sun4/2.2.2/specs
>gcc version 2.2.2
> /usr/local/gnu/lib/gcc-lib/sun4/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 tt.cc /usr/tmp/cca02685.i
>GNU CPP version 2.2.2 (sparc)
> /usr/local/gnu/lib/gcc-lib/sun4/2.2.2/cc1plus /usr/tmp/cca02685.i -quiet -dumpbase tt.cc -version -o /usr/tmp/cca02685.s
>GNU C++ version 2.2.2 (sparc) compiled by GNU C version 2.2.2.
>tt.cc:24: request for member `p1' is ambiguous




-- 
Johan Garpendahl                   | Email: garp@isy.liu.se
Linkoping University               | Phone: +46 - 13 - 28 13 24
Dept. of Electrical Engineering    | Fax  : +46 - 13 - 13 92 82
S-581 83  LINKOPING // SWEDEN      | This space is left blank.
Technical Details
Message-ID: <garp.712226058@isy.liu.se>
Path: arc1-ca.pugleaf.net!sparky!uunet!wupost!cs.utexas.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!isy.liu.se!garp
References: <9207241326.AA02693@lin.isy.liu.se>

Show Full Headers
Complete Article Headers
Newsgroups: gnu.g++.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!wupost!cs.utexas.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!isy.liu.se!garp
From: garp@isy.liu.se (Johan Garpendahl)
Subject: Re: "Weird" bug in g++-2.2.2
Message-ID: <garp.712226058@isy.liu.se>
Sender: gnulists@ai.mit.edu
Organization: Dept of EE, University of Linkoping
References: <9207241326.AA02693@lin.isy.liu.se>
Distribution: gnu
Date: Mon, 27 Jul 1992 08:34:18 GMT
Approved: bug-g++@prep.ai.mit.edu
Lines: 70