marsh@CS.ROCHESTER.EDU (Brian Marsh) (02/14/89)
The following short program generates an error message in which the actual parameter causing the violation is the *third* argument, not the *second* as reported by the compiler. 1 % g++ -v g++ version 1.32.0 2 % cat bug.cc struct chars { char contents[ 3 ] ; } struct type_d ; struct oper_d { oper_d( type_d *Argument, type_d *Result, chars *Label ) ; } ; struct type_d { int size ; type_d( ) ; } ; struct build_d : type_d { type_d *base ; build_d( type_d *Base, type_d *Argument ) ; } ; build_d::build_d( type_d *Base, type_d *Argument ) { size = 0 ; base = Base ; oper_d *oper = new oper_d( Argument, Base, (char *)0 ) ; } 3 % g++ bug.cc bug.cc:7: semicolon missing after declaration of `chars' In function struct build_d *build_d::build_d (struct type_d *, struct type_d *) : bug.cc:33: bad argument 2 for function `oper_d::oper_d (struct type_d *, struct type_d *, struct chars *)' (type was struct type_d *) 4 %