newsuser@LTH.Se (LTH network news server) (04/10/89)
I have just found bug AT&T cfront 1.2. It may be well-known to many
people, but maybe not to everybody. (Is this the last possibility to
report bugs on 1.2 ? (:-))
Source program follows:
class C {
public:
void f(float);
virtual void g(float);
};
main ()
{
C x;
x.f(1); // ok
x.g(1); // error
}
Calling the non-virtual C::f(), the integer 1 is converted to a floating
point 1. Calling the virtual C::g(), no conversion takes place.
My compiler (with the fixes supplied with InterViews) produces this main
program (#line directives removed):
int main (){ _main();
{
struct C _au1_x ;
( ( ((& _au1_x )-> _C__vptr = C__vtbl), (((& _au1_x )))) ) ;
_C_f ( & _au1_x , (float )1 ) ;
(*(((char (*)())(*(& _au1_x )-> _C__vptr ))))( & _au1_x , 1 ) ;
}
};
Dag Bruck
--
Department of Automatic Control Internet: dag@control.lth.se
Lund Institute of Technology
P. O. Box 118 Phone: +46 46-108779
S-221 00 Lund, SWEDEN Fax: +46 46-138118