🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Ron Guilmette Sun, 02 Jul 1989 20:48
BUG in G++ 1.35.0 (b088)
#87
Author: Ron Guilmette
Date: Sun, 02 Jul 1989 20:48
32 lines
1450 bytes
The following test, when compiled with G++ 1.35.0.0/sun3 generates
no errors.  I believe that an error should be generated on the
line indicated.  This would be in keeping with general philosophy
that says that private data members may only be accessed (i.e. read/written)
by member functions.

---------------------------------------------------------------------
// Check that initialization of private data members is illegal
// except via the use of an explicit constructor.

class friendly;

class base {
	int data_member_1;			// private data member
public:
	int data_member_2;
	friend class friendly;			// prevent warnings
	void function_member ();
};

void test ()
{
	base object = { 3, 5 };			// ERROR

	object.function_member ();		// prevent warnings
}
---------------------------------------------------------------------

// Ron Guilmette  -  MCC  -  Experimental Systems Kit Project
// 3500 West Balcones Center Drive,  Austin, TX  78759  -  (512)338-3740
// ARPA: rfg@mcc.com
// UUCP: {rutgers,uunet,gatech,ames,pyramid}!cs.utexas.edu!pp!rfg
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