Yes, 1<<-3 can be detected as UB at compile time when doing constant propagation. But that wasn't my point (you could declare this expression invalid, no need for UB). I was pointing out that UB is not about "meaningless yet syntactically valid constructs" (if there is such a thing at all; I won't argue). UB in general manifests at run time. So I was only proposing a reformulation.
> In any case, C, in fact, often does have a runtime. What do you think executes main()?
Sure, that's why I said it has "no runtime" (in quotes). I'm not trying to split hairs here.
> In any case, C, in fact, often does have a runtime. What do you think executes main()?
Sure, that's why I said it has "no runtime" (in quotes). I'm not trying to split hairs here.