I consider it a bug to declare a function parameter (in C++ obviously) as a reference (with &) if the value is modified in the function. The problem is, you can't tell by looking at the function call if it is pass by reference or pass by value--you have to go back and look at the function or its prototype or just remember. And there are far too many things to remember already.
Originally Posted by jlewand
I've taken to commenting other people's code which I chance to touch, and my own code if I have to call such a function. I make the call look like this:
int func(int& var); // Declared somewhere like this
x = func(/*&ref*/var); // My comment draws attention to the gotcha