Consider the following code snippet:
class A
{
int b[A::a];
void foo(){ int b = A::a; }
static const int a = 5;
}
Paragraph 3.4.3.1/1 (Qualified Name Search, Class Members) said:
If a qualified identifier nested name qualifier assigns a class, the name specified after defining the nested qualifier name in the class scope (10.2)
This means that the name aafter the nested qualifier name in //1both and //2will be displayed in the scope of the class.
Paragraph 10.2 (Search for username) said:
10.2 / 2
The following steps determine the name lookup result for the member name f in class C.
10.2 / 3
The search set for f in C called S (f, C) ...
S (f, C) is calculated as follows:
10.2 / 4
C f, f, C, , .
:
, //1 //2 . . ?
. . :
class A
{
int b[a];
void foo(){ int b = a; }
static const int a = 5;
}
, 3.4.1/7 3.4.1/8 ( ).
user2953119