[gnu.g++.bug] Type checking in constructors

tpf@jdyx.UUCP (Tom Friedel) (09/09/89)

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."