🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

g++ 1.34.1 bug

#1799
From: Gregg Whitcomb
Date: Wed, 29 Mar 1989 01:58
51 lines
1024 bytes
version: 1.34.1

example:
#include "stream.h"

class c;
class xx;
class b
   {
   int y;
   int x;
   b(int j, int i = 9) {y = j; x = i;}
   void print() {cout << x << "\n";}
   friend xx;
   };

class c : public b
   {
   c(int i = 1) : (5,i) {}
   void print() { b::print(); }
   friend void m();
   };


void m()
{
   c a;
   a.print();
   c* e;
   e = new c();
   e->print();

}


main()
{
   m();
}


% g++ -g testinit.cc
% a.out
0
0

-------------------

if class b was a friend of class c, this program works correctly.
As is, an error or warning should be generated but is not.
Technical Details
Message-ID: <8903290158.AA20749@eros.berkeley.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!EROS.BERKELEY.EDU!whitcomb

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!EROS.BERKELEY.EDU!whitcomb
From: whitcomb@EROS.BERKELEY.EDU (Gregg Whitcomb)
Newsgroups: gnu.g++.bug
Subject: g++ 1.34.1 bug
Message-ID: <8903290158.AA20749@eros.berkeley.edu>
Date: 29 Mar 89 01:58:35 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 51