Thread View: gnu.g++.bug
1 messages
1 total messages
Started by Tom Friedel
Fri, 08 Sep 1989 23:03
Type checking in constructors
Author: Tom Friedel
Date: Fri, 08 Sep 1989 23:03
Date: Fri, 08 Sep 1989 23:03
51 lines
1525 bytes
1525 bytes
This program was run under 1.35.0 on i386-sysv. I've observed
similar behavior on an early 1.36 beta relase on a Sun/4, but
have not run this exact program.
The comments should indicate where I feel that the compiler
should at least print warnings.
//-------------------------------------------------
class A {
public:
int a ;
A() { } ;
};
class B {
public:
int b,c;
B() { } ;
B( A& ) { } ;
};
main () {
A y ;
B z( y ) ; // OK
B w( z ) ; // perhaps OK (default constructor)
A r( z ) ; // no warning.
B v( (char *) "HI" ) ; // I would hope for at least a warning.
B u( 1 ) ; // again no warning
A t( 1 ); // again no warning
// A s( 1, 2, 3 ); This does generate an error.
}
Tom Friedel
Tom Friedel (404) 320-7624 tpf@jdyx.UUCP
also: tpf@jdyx.atlanta.ga.us ...gatech!emory!jdyx!tpf
Public Access Unix BBS: (404) 321-5020
"Live simply, so that others may simply live."
--
Tom Friedel (404) 320-7624 tpf@jdyx.UUCP
also: tpf@jdyx.atlanta.ga.us ...gatech!emory!jdyx!tpf
Public Access Unix BBS: (404) 321-5020
"Live simply, so that others may simply live."
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