text: . variable]) and friend declarations ([class.friend]) may introduce a (possibly not visible) name into an enclosing namespace; these restrictions apply to that region. Local extern declarations ([basic.link]) may introduce a name into the declarative region where the declaration appears and also introduce a (possibly not visible) name into an enclosing namespace; these restrictions apply to both regions. — end note ]
  [ Note: The name lookup rules are summarized in [basic.lookup]. — end note ]
  The point of declaration for a name is immediately after its complete declarator (Clause [dcl.decl]) and before its initializer (if any), except as noted below. [ Example:
  int x = 12;{ int (Clause [class]). The point of declaration for an enumeration is immediately after the identifier (if any) in either its enum-specifier ([dcl.enum]) or its first opaque-enum-declaration ([dcl.enum]), whichever comes first. The point of declaration of an alias or alias template immediately follows the type-id to which the alias refers. (Clause  ]
  A name declared in a block ([stmt.block]) is local to that block; it has block scope. Its potential scope begins at its point of declaration ([basic.scope.pdecl]) and ends at the end of its block. A variable declared at block scope is a local variable.
  The potential scope of a function parameter name (including one appearing in a lambda-declarator) or of a function-local predefined variable in a function definition ( shall not be redeclared in the outermost block of the function definition nor in the outermost block of any handler associated with a function-try-block.
  The name declared in an exception-declaration is local to the handler and shall not be redeclared in the outermost block of the handler.
  Names declared in the for-init-statement, the for-range-declaration,].
  In a function declaration, or in any function declarator except the declarator of a function definition ([dcl.fct.def]), names of parameters (if supplied) have function prototype scope, which terminates at the end of the nearest enclosing function declarator.
  Labels ([stmt.label]) have function scope and may be used anywhere in the function in which they are declared. Only labels have function scope. namespace l+a; // l is from unnamed namespace } int i; // error: duplicate definition int j(); // OK: duplicate function declaration int j() { // OK: definition of N::j() return g(i); // calls N::g(int) } int q(); // error: different return type }
  — end example ]
  A namespace member can also be referred to after the :: scope resolution operator ([expr.prim]) applied to the name of its namespace or the name of a namespace which nominates the member's namespace in a using-directive; see [namespace.qual].
  The outermost declarative region of a translation unit is also a namespace, called the global namespace. A name declared in the global namespace has global namespace scope (also called global scope). The potential scope of such a name begins at its point of declaration ([basic.scope.pdecl]) and ends at the end of the translation unit that is its declarative region. Names with global namespace scope are said to be global name.
  The N used in a class S shall refer to the same declaration in its context and when re-evaluated in the completed scope of S. No diagnostic is required for a violation of this rule.
  If reordering member declarations in a class yields an alternate valid program under (1) and (2), the program is ill-formed, no diagnostic is required.
  A name declared within a member function hides a declaration of the same name whose scope extends to or past the end of the member function's class. .
  The name of a scoped enumerator ([dcl.enum]) has enumeration scope. Its potential scope begins at its point of declaration and terminates at the end of the enum-specifier. { }; // #1 template<class U> void f(U) { } // #2 struct B { template<class V> friend int g(struct C*); // #3 }; }
  The declarative regions of T, U and V are the template-declarations on lines #1, #2 and  ([temp.local]), a template parameter's scope is often its potential scope. However, it is still possible for a template parameter name to be hidden; see [temp.local]. — end note ]
  A name can be hidden by an explicit declaration of that same name in a nested declarative region or derived class ([class.member.lookup]).
  A class name ([class.name]) or enumeration name ([dcl.enum]).
  In a member function definition, the declaration of a name at block scope hides the declaration of a member of the class with the same name; see [basic.scope.class]. The declaration of a member in a derived class (Clause [class.derived]) hides the declaration of a member of a base class of the same name; see [class.member.lookup].
  During the lookup of a name qualified by a namespace name, declarations that would otherwise be made visible by a using-directive can be hidden by declarations with the same name in the namespace containing the using-directive; see ([namespace.qual]).