Of course the manufacturers, who have vested financial insterest, will make you think otherwise.
But even if you manage to do that somehow, that is a specific problem. Using a general statement like 'flashing voids your warranty' remains weird (and wrong imo).
"Stuffing your phone in your pockets voids your warranty. Because if you stuff it in your back pocket and sit down on it, hard, it's not the manufacturer's fault if the screen breaks. Is it?"
That said, even if you flash stuff without reading instructions or fully understanding what you do: Most errors I've seen are flat-out not working (software stating: "Can't do this, you're messing up") or recoverable/soft-bricks only.
(In the end it doesn't matter if you CAN kill your phone by flashing nonsense: That still wouldn't make a good argument for "Flashing voids the manufacturer's warranty". I'd just mean that those individuals who bricked their phone .. might not be covered.)
Apple added "been in water detection" to avoid payout on that very activity.
If I flash my phone and later some part of it breaks because it came bad from factory, that is independent of me flashing the phone and should be covered.
GP replied to one of my posts, saying that there IS a real risk of bricking your phone when you flash it (I don't disagree, but consider it unlikely).
By comparing the process with a totally different ~real risk~ (phone -> toilet) I'm trying to drive the point home that it isn't a problem of either flashing your phone or playing some mobile game on that white throne of yours, it is a problem of being careless. Bricking my phone shouldn't be covered by a warranty. Flash or flush doesn't matter.
But trying to imply that the warranty is void because I installed software is overly broad and crazy: If I flash CM today and the phone dies in a month from now due (battery dead, hardware issues w/ screen or power button, antenna issues, pick anything faulty you had with a vanilla/unchanged handset in the past), then CM isn't to blame and my phone has a working warranty (for all I know, for all I care - and anything else seems completely unacceptable in my world).
Of course, this depends on the laws in your jurisdiction.
"What did you do that bricked your phone?"
"I flashed some custom firmware and stopped the flash mid-way"
"But how? All our phones are locked"
"I unlocked it"
"Aha! That is the real culprit!"