Shared Cold Water Overflow & TPR Overflow Pipe?

I haven’t seen this setup before and unsure if proper. Any thoughts?

20180713-67.jpg

Not supposed to be done that way, but the AHJ’s around here allow it, and plumbers won’t fix it. You can decide for yourself how to approach it.

Dom.