StormWingDelta: What you said makes no sense and what you meant to say has already been said multiple times. An IDE (Integrated Development Environment)
does absolutely not optimize anything, it doesn't even produce any kind of binary code. The compiler creates the binary code and does the optimization! By now you should really be able to tell the difference between an IDE and a compiler.
I am reluctant to believe the compiler can optimize away the copy in a pass by value in this case. Draw is a virtual function and it may not be known until run-time whether the states parameter is modified or not by the resolved function.
Programming is never about any kind of believe. Study, try, test, profile. The easiest way is really to go write reliable test cases. The harder way is to go study what the standard allows and what the compilers actually do (of course that only works for open source compilers).
As for the discussion in general: Stop trying to optimize stuff which hasn't been proven to be a bottleneck in anyone's code.