🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Gordon Joly Fri, 05 May 1989 12:47
Re: virtual default args problem
#1950
Author: Gordon Joly
Date: Fri, 05 May 1989 12:47
53 lines
2070 bytes
Tim,
Is this fixed in 1.35.0- ?
Gordon.

karl:/stats/staff/karl/gordon/c++[60] make scoobie
g++ -g  -lg++ -lm  scoobie.cc   -o scoobie
scoobie.cc:13: sorry, not implemented: that operation not supported for default parameters
g++: Program c++ got fatal signal 6.
make: *** Error 1
karl:/stats/staff/karl/gordon/c++[61] g++ -v
g++ version 1.35.0-
karl:/stats/staff/karl/gordon/c++[62] date
Fri May  5 13:44:03 BST 1989
karl:/stats/staff/karl/gordon/c++[63] cat -n scoobie.cc
     1	//The below example gives a 'Program c++ got fatal signal 6.' under
     2	// g++ version 1.34.2.
     3	// ---------
     4	#include <String.h>
     5	
     6		String blurb("bleah");
     7	
     8	class Foo
     9	{	String a;
    10	public:
    11		Foo()	{}
    12		virtual void scooby(String s=blurb)			{a=s;}
    13		virtual void doobie(String s=String("bleaurgh"))	{a=s;}
    14	};
    15	
    16	class Bar : public Foo
    17	{	String b;
    18	public:
    19		Bar()	{}
    20		virtual void scooby(String s=blurb)			{b=s;}
    21		virtual void doobie(String s=String("bleaurgh"))	{b=s;}
    22			// Above line causes problem
    23	};	
    24	
    25	main()
    26	{	Foo x;
    27		Bar y;
    28	
    29		exit(0);
    30	}
    31	// ----------
    32	// Commenting out the 'doobie' member function of 'Bar' eliminates this.
    33	// I'm not sure if this sort of default arg. should be allowed anyway since
    34	// the two 'String("bleaurgh")'s are effectively different things, but obviously
    35	// an error message of some sort is preferable
    36	// 
    37	// Tim
    38	
karl:/stats/staff/karl/gordon/c++[64] 
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