Please don't reprint this article; please don't re-publish in any form; please delete it within 24 hours of downloading this article; it is forbidden to use this article for commercial purposes.
3 Basic Concepts [Basic] 3.3 Declarative Regions and scopes [Basic.Scope] 3.3.1 Point of Dechannel [Basic.scope.pdecl] 3 Basic Concepts [Basic] 3.3 Define Areas and Scope [Basic. Scope] 3.3.1 Declaration points [basic. Scope. Declaration points] The point of declaration for a name is immediately after its completion declarator (CLAUSE 8) And Before ITS Initializer (if any), Except as noteed below. [EXample: int x = 12; {INT x = x;} Here the second x is initialized with its oow (Indeterminate) Value. In addition to the following annotations, a certain name declaration point starts immediately after its declaration (chapter 8) is completed, and Before the initializer (if any). [Example: INT X = 12; {INT X = X;} The second X is initialized by its own value (uncertain). 】 [NOTE: A NONLOCAL NAME Remains Visible Up to the point hides it. [EXAMPLE: const I = 2; {INT i];} Declares a local array of two integers.]] [Note: Non-local names maintain its visibility until the declaration point of its local name. [Example: const I = 2; {INT i [i];} Declares a partial array of two integers. 】] The point of declaration for an enumerator is immediately after its enumerator-definition. [EXAMPLE: const INT x = 12; {enum {x = x};} here, the enumerator x is initialized with the value of the constant x, Namely 12.] The declaration of enumerations begins immediately after the enumeration is defined. [Example: const INT x = 12; {enum {x = x};} Here, enumeration X is initialized by constant x, that is, 12. 】 After the point of declaration of a class member, The Member Name Can Be Looked Up in The Scope of Its Class. [NOTE: this is true evening. For example, struct x {enum e {z = 16}; INT B [x :: z]; // ok}; --end note] After the declaration point of the class member, the member name can be found in its class scope. [Note: Even if the class is incomplete.
For example, struct x {enum e {z = 16}; int b [x :: z]; // can}; follows: for an elaborated-type-specifier of the form class-key identifier; the elaborated-type-specifier declares the identifier to be a class-name in the scope that contains the declaration, otherwise for an elaborated-type-specifier of the form class-key identifier if the elaborated-type-specifier is used in the decl-specifier-seq or parameter-declaration-clause of a function defined in namespace scope, the identifier is declared as a class-name in the namespace that contains the . declaration; otherwise, except as a friend declaration, the identifier is declared in the smallest non-class, non-function-prototype scope that contains the declaration [Note: if the elaborated-type-specifier designates an enumeration, the identifier must refer To an already declared enum-name. if The Identifier I N the elaborated-type-specifier is a qualified-id, it must refer to an already declared class-name or enum-name. See 3.4.4.] As follows, the category declaration points are first declared by a detailed type limit word: