The value returned by foo is only temporarily valid.
For example: You won't be able to pass an intermediate value to Foo ( like: Foo(10) ), because a reference must 'refer' to an object, which it cannot as '10' isn't stored anywhere (It is for the runtime of the function, but after that it's invalid).
For the same reason you can't pass the result returned by foo to another function that expects a reference to a variable. The result of foo isn't stored anywhere, it's temporary. Thus you shouldn't be able to refer to it.
Offending line: Foo(Foo(a))
Edit: Maybe VC7 allows this because it actually 'sees' that you're not modifying the passed parameter, or maybe it has a different 'expiration date' of returned values...
. Are you sure you did not return a float& in the VC code?
[edited by - Wildfire on August 19, 2003 3:58:20 AM]