🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Reference casting bug in g++-1.36.2-jan7

#2159
From: fox
Date: Thu, 11 Jan 1990 16:03
19 lines
972 bytes
There seems to be a problem with casting references into
derived types.  The following program elicits the error message:

  bug.C:5: request for member `i' in something not a class, structure or union

This worked in g++-1.36.2-dec21.  Let me know if this bug is
reproducable, so I can tell if there is some problem with the
way I compiled the compiler.

---------------- cut here ----------------
class Base {};

class Derived : public Base {
  int i;
  void f(Base& a) {return ((Derived&)a).i;}
};
------------------------------------------
David Fox
fox@allegra.att.com
Technical Details
Message-ID: <9001111604.AA01470@life.ai.mit.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!devo.att.com!fox

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!devo.att.com!fox
From: fox@devo.att.com
Newsgroups: gnu.g++.bug
Subject: Reference casting bug in g++-1.36.2-jan7
Message-ID: <9001111604.AA01470@life.ai.mit.edu>
Date: 11 Jan 90 16:03:37 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 19