//vs2017
//在c++文档中找了一下,没找到,暂时先以编译器的编译结果为准
struct A {
A(int = (A(5), 6666)) noexcept;//pass
operator int()
{
return 2333;
}
int _a;
};
A::A(int a) noexcept //pass
: _a(a)
{
std::cout << __FUNCTION__ << std::endl;
}
int main(){
A a;
struct MyStruct
{
int c;
int i[0]; //pass
}i;
i.c = 12;
int j = sizeof(i); // j = 4
int *c = new int[0]; //pass
if (c)//pass
{
int j = 0;//pass
}
delete c; //pass
delete c; //run error
int k[0]; //compile error
}
//output
A::A
A::A