I think I may already know the answer to this, but am interested in opinion on course of action that is best to take.
Recently a question was posted regarding an analysis of a potential memory leak in a simple C++ function pair. The question was essentially "Will this leak memory" ? The question should have been "Will this leak memory if I ever get it to compile and run" since it would not. (pushing an int* into a std::vector ergo. not a happy gcc).
I answered both the question (with or without the fixed code, it would leak memory) and followed by pointing out that the code was broken anyway and you can't be pushing int* items into a std::vector. My answer was up-voted twice. Shortly thereafter the OP fixed the code in the question, and shortly after that the down-votes rolled in since the answer no longer matched the question (all of them without justification comments for why, naturally).
Is there anything that an answerer can/should do at this point besides taking their lumps and realizing that some people will never bother to take the time to see the edit history of a question? Furthermore, is it the answerer's responsibility to ensure that, for the lifetime the OP sees to service it, changes in their question should trigger a change in your answer or face the wrath of passer's by? Is it best to just delete the answer (something we have a daily limit on doing, so it may be there awhile)? What has your experience been in the past? I ended up just deleting the answer, but I'm hoping this is an exception and not a rule.
Thanks for taking the time to listen. I hope you all have a great day.