Thread View: gnu.g++.bug
1 messages
1 total messages
Started by Ron Guilmette
Sat, 11 Mar 1989 00:46
BUG in G++ 1.34.0 - overloaded methods with defaults
Author: Ron Guilmette
Date: Sat, 11 Mar 1989 00:46
Date: Sat, 11 Mar 1989 00:46
33 lines
1557 bytes
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
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