我很确定这是 VS 2010 中的一个错误,但检查 SO 总是一个好主意
struct A{
static int s;
};
struct B{
static int s;
};
struct C : A, B{
void fn(short s){ // Ambiguous access of 's' here!!!
s = 2;
}
};
int A::s;
int B::s;
int main(){
C c;
}
VS给出-“错误C2385:'s'的模糊访问”。
g++ 和 Comeau 编译得很好。
我错过了什么吗?