title: Can't understand the declaration #3 in the Example of [basic.link]/6 C++14
body: <p>[basic.link]/6</p>
  
  <blockquote>
    <p>The name of a function declared in block scope and the name of a
    variable declared by a block scope <code>extern</code> declaration have linkage.
    If there is a <strong>visible</strong> declaration of an entity with linkage having the
    same name and type, ignoring entities declared outside the innermost
    enclosing namespace scope, the block scope declaration declares that
    same entity and receives the linkage of the previous declaration. If
    there is more than one such matching entity, the program is
    ill-formed. Otherwise, if no matching entity is found, the block scope
    entity receives external linkage.[ Example:</p>
  
  <pre><code>static void f();
  static int i = 0; // #1
  void g() {
      extern void f(); // internal linkage
      int i; // #2 i has no linkage
      {
          extern void f(); // internal linkage
          extern int i; // #3 external linkage
      }
  }
  </code></pre>
    
    <p>There are three objects named <code>i</code> in this program. The object with internal linkage introduced by the declaration in global scope (line #1), the object with automatic storage duration and no linkage introduced by the declaration on line #2, and the object with <strong>static storage duration and external linkage</strong> introduced by the declaration on line #3. —end example ]</p>
  </blockquote>
  
  <p>I have two comments about this paragraph:</p>
  
  <ol>
  <li>The <code>static int i = 0;</code>declaration in the global scope is <strong>not</strong> visible inside the block containing the declaration <code>extern int i;</code> (#3). Therefore we can only say that this latter declaration has external linkage, i.e., we can't associate it with declaration #1.</li>
  <li>Otherwise, if the declaration <code>static int i;</code> is considered visible by the declaration #3, than according to the text in the paragraph, the block scope declaration declares the same entity and receives the linkage of the previous declaration, that is, internal linkage, and not external linkage, as stated in the Example.</li>
  </ol>
  
  <p>What am I missing here? </p>