Is it possible for clang to give a compiler error if you accidentally set a const global variable to another static const variable in C++ (in different translation units).
Since the behaviour is pretty much undefined, it would be very useful to detect if doing this accidentally.
EDIT: My question is different from the one linked above, since I'm looking for a compiler warning/error message to force me NOT to assign any static global variable to another static variable. I basically want to be forced by the compiler to avoid the whole fiasco. I'm wondering if that's possible.