M
miaohua1982
under the same warning level, the code is:
class X{
public:
X(){}
virtual void g(){}
};
void f(int i){
if(i<10)
goto jump1;
X x1;
jump1: //warning C4533: initialization of 'x1' is skipped by 'goto
jump1',why there is only a warning?
switch(i){
case 1:
X x2;
break;
case 2: //error C2360: initialization of 'x2' is skipped by 'case'
label
X x3;
break;
}
}
class X{
public:
X(){}
virtual void g(){}
};
void f(int i){
if(i<10)
goto jump1;
X x1;
jump1: //warning C4533: initialization of 'x1' is skipped by 'goto
jump1',why there is only a warning?
switch(i){
case 1:
X x2;
break;
case 2: //error C2360: initialization of 'x2' is skipped by 'case'
label
X x3;
break;
}
}