Почему using uninitialized variable — это варнинг, а initialization of variable is skipped by case label — еррор?
Здравствуйте, BlaineMono, Вы писали:
BM>Почему using uninitialized variable — это варнинг, а initialization of variable is skipped by case label — еррор?
Потому, что "uninitialized variable" допустима с точки зрения стандарта, а прыжок через инициализацию — нет.
6.7/3:
It is possible to transfer into a block, but not in a way that bypasses declarations with initialization.
A program that jumps from a point where a local variable with automatic storage duration is not in scope to a
point where it is in scope is ill-formed unless the variable has POD type (3.9) and is declared without an
initializer (8.5).