> I stated my opinion on the matter in this thread.

Ah I see.  Spec is out of date, compiler is right, there is nothing wrong with this code.

> With Dscanner this should be trivially implementable as an external tool.

Not really, because you would need to do flow analysis to prevent false positives.