🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

g++ 1.32 allows illegal implicit pointer conversion

#1635
From: Tom Vijlbrief
Date: Thu, 26 Jan 1989 10:37
31 lines
1401 bytes
g++ 1.32 (under SunOs 3.5, sun 3/60) allows the following
program which is illegal according to Stroustrup's book
(The C++ programming language), example on page 197.

class base {
	int     m1;
public:
	int     m2;
};

class derived : base {
};

derived d;
base    *pb= &d;        // error (private base) 

==============================
CC -v -S der.cc
g++ version 1.32.0
 /usr/local/lib/gcc-cpp -+ -v -undef -D__GNU__ -D__GNUG__ -Dmc68000 -Dsun -Dunix der.cc /tmp/cca07199.cpp
 GNU CPP version 1.32
  /usr/local/lib/gcc-c++ /tmp/cca07199.cpp -quiet -dumpbase der.cc -noreg -version -o der.s
  GNU C++ version 1.32.0 (68k, MIT syntax) compiled by GNU C version 1.32.

===============================================================================
Tom Vijlbrief
TNO Institute for Perception
P.O. Box 23				Phone: +31 34 63 62 77
3769 ZG  Soesterberg			E-mail: tnosoes!tom@mcvax.cwi.nl
The Netherlands				    or:	uunet!mcvax!tnosoes!tom
===============================================================================
Technical Details
Message-ID: <434@tnosoes.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!uunet!mcvax!hp4nl!tnosoes!tom

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!uunet!mcvax!hp4nl!tnosoes!tom
From: tom@tnosoes.UUCP (Tom Vijlbrief)
Newsgroups: gnu.g++.bug
Subject: g++ 1.32 allows illegal implicit pointer conversion
Keywords: g++ 1.32
Message-ID: <434@tnosoes.UUCP>
Date: 26 Jan 89 10:37:57 GMT
Organization: TNO Institute for Perception, Soesterberg, The Netherlands
Lines: 31