Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!uunet!mcvax!ukc!servax0!ese.essex.ac.uk!goss From: goss@ese.essex.ac.uk (Gossain Sanjiv) Newsgroups: gnu.g++.bug Subject: a funny little one Message-ID: <1175@servax0.essex.ac.uk> Date: 23 Jun 89 11:45:24 GMT Sender: news@servax0.essex.ac.uk Reply-To: goss@ese.essex.ac.uk (Gossain Sanjiv) Distribution: gnu Organization: University of Essex, Colchester, UK Lines: 40 Here's a funny little one... ....coutesy of Bruce Anderson, Dept. of ESE, Essex University Colchester, Essex, UK. < bruce%ese.sx.ac.uk@nsfnet-relay> /* funny in reference argument checking and execution This code does not compile with AT&T 1.2; with g++ 1.35 it gives 99--99--99.1 0--0--8.48798e-315 This can't be right! My own belief is that it should fail to compile; otherwise how about correct coercion both ways? */ #include void zap(int& x) { x = 0; } main() { int i = 99; double d = 99.0; double d1 = 99.1; cout << i << "--" << d << "--" << d1 << "\n"; zap(i); zap(d); zap(d1); cout << i << "--" << d << "--" << d1 << "\n"; } ______________________________________________ Sanjiv Gossain Dept. of ESE Essex University Colchester CO4 3SQ ENGLAND