If you wanted to prohibit all stupid constructs in C++ (and C too for that matter) you would get a pretty long list.
C++ is in practice a very different language compared to C, but it still have its roots there. And, at least in the beginning, the focus on being compatible with C was very strong. Even today the C++ standard includes C headers for that purpose.
So many of these strange things can be traced back to C, and C is a language that puts little demands on the compiler but more demands on the programmer. Many constructs yields undefined behavior or indeterminate value. There are two main reasons for this. First, it makes it easier to write the compiler correctly and having low system requirements. This was important in the early days of C. This language came 1972, which is 8 years before Commodore released the home computer VIC-20 with 4kB of memory. Secondly, it allows the compiler to produce faster code with less memory usage, which - as just mentioned - was very important in the past.
So even if there isn't any valid use case at all (I don't rule out the chance that it might be even if I cannot see it) there isn't really a strong enough reason to do something about it.
As Keith mentioned in his answer, if the variable is static, then it will have the value 0, which means that the value is not indeterminate. The result of static int x = x;
is completely clear, so why forbid it? You would make the C++ specification bigger and harder to maintain and possibly break some old code, just to solve something that isn't a problem.
When it comes to non-static variables, it's a another thing because the value is indeterminate. Here there is a better reason to prohibit this construct, but on the other hand, you already get a warning for it. At least if you are using -Wall
, which you should. I might also add that many warnings are warnings instead of error just to not break old code. But rather than forbidding initialization to itself, it would make more sense to prohibit usage of uninitialized variables completely.