Highlighting bad encodings?

While fixing a small issue with range highlighting of invalid character encodings in string literals I wondered about the desirability if highlighting _every_ invalid character encoding in a string literal rather than simply the first one. Is there any reason to prefer only highlighting the first one?

The result would be something like this:

wrong-encoding.c:28:6: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
  "xx<E9><BF><E9><BF>d";
     ^~~~~~~~
wrong-encoding.c:28:8: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
  "xx<E9><BF><E9><BF>d";
             ^~~~~~~~

Attached is a patch that highlights all the invalid characters, but if possible I'd like them all to be highlighted in a single diagnostic. Is it possible to apply multiple ranges to one diagnostic in this case?

0001-improve-highlighting-of-invalid-string-encodings.patch (4.28 KB)

There isn't any limit to the number of ranges. I don't think there's
any existing code which tries to add ranges to highlight in a loop...
but it should be possible. You just need to bind a reference to the
DiagnosticBuilder to keep it alive long enough.

-Eli