🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Gregg Whitcomb Wed, 29 Mar 1989 01:58
g++ 1.34.1 bug
#1799
Author: 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.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads