Compilers can still diagnose something as a warning even if it's not UB.

Warnings are poisoned in C++. It is popular to tell C++ compilers to convert all their warnings into fatal errors. So your only options are "Silently allow probably bad code" and "Program does not compile" because C++ programmers are allergic to nuance.

Can, yes. Must, no.