Path: utzoo!telly!attcan!dptcdc!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!CS.ROCHESTER.EDU!marsh From: marsh@CS.ROCHESTER.EDU (Brian Marsh) Newsgroups: gnu.g++.bug Subject: Bogus error message Message-ID: <8902141337.AA12682@birch.cs.rochester.edu> Date: 14 Feb 89 13:37:23 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 49 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 %