In C++, the enumeration is never Integer, and the enumeration condition judgment is added to avoid compiling errors when it is initialized to an integer.
Add support for initialization check of scope enum.
As the following case show, clang-tidy will give a wrong automatic fix:
enum Color {Red, Green, Blue}; enum class Gender {Male, Female}; void func() { Color color; // Color color = 0; <--- fix bug Gender gender; // <--- no warning }
Also, if we're using Optional, this could also be = nullptr instead, and then we have the state when the Optional hasValue() but the value itself is null. In all other cases, it both hasValue() and the value is non-null.
This would also eliminate the need for the strlen call.