PR52905 was originally papered over in a different way, but I believe this is the actually proper fix, or at least closer to it. We need to detect placeholder types as close to the front-end as possible, and cause them to fail constraints, rather than letting them persist into later stages.
Fixes https://llvm.org/PR52905
Fixes https://llvm.org/PR52909
Fixes https://llvm.org/PR53075
sorry to be picky, but
(a) why the {...} on the single body stmt? Isn't that against style?
(b) are we sure the if's condition is sufficiently const so that it goes away when the assert is inactive? if's containing a single assert make me nervous.