🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

BUG in G++ 1.34.0 - overloaded methods with defaults

#1722
From: Ron Guilmette
Date: Sat, 11 Mar 1989 00:46
33 lines
1557 bytes
Using G++ 1.34.0/Sun3, errors are issued if you have overloaded
functions which only differ by some number of "defaultable"
arguments.  The same does *not* appear to be true for method
declarations within classes, as demonstrated by the following
short code (which should get some compile-time errors, but does not).

/*
Description - check that if two overloaded methods are declared within the
		same class, and if these two methods are essentially
		identical in their names and in their number, order,
		and type of parameters except that one of the two has
		more parameters than the other, but these additional
		parameters all have defaults, an error message is
		issued for the (ambiguous) declaration(s).
*/

struct class1 {
	void method1 (int arg1, int arg2);
	void method1 (int arg1, int arg2, int arg3 = 77);
};

main ()
{
	class1 class1_object;

	class1_object.method1 (88, 99);
}

// Ron Guilmette  -  MCC  -  Experimental (parallel) 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
Technical Details
Message-ID: <8903110046.AA08693@riunite.aca.mcc.com>
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!uunet!bu-cs!bloom-beacon!tut.cis.ohio-state.edu!MCC.COM!rfg

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!uunet!bu-cs!bloom-beacon!tut.cis.ohio-state.edu!MCC.COM!rfg
From: rfg@MCC.COM (Ron Guilmette)
Newsgroups: gnu.g++.bug
Subject: BUG in G++ 1.34.0 - overloaded methods with defaults
Message-ID: <8903110046.AA08693@riunite.aca.mcc.com>
Date: 11 Mar 89 00:46:02 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 33