请考虑以下代码段:
class A
{
void foo(){ A a; }//1. Ok, because A is complete type here
int b[A::c];//2. Error, because incomplete type denoted by A does not contain c as a member.
static const int c = 6;
}
关于这种行为,我假设//1
和//2
中的A实际上指的是不同的实体。但在A
的名称查找过程(3.4.1,非限定名称查找)期间,//1
中将找到相同的 注入的类名 和//2
。这很好奇。
我想从标准中找到规范性的参考资料。