title: Can a local variable have the same name as a namespace?
body: <p>GCC, clang and VS2013 compile the snippet below:</p>
  
  <pre><code>namespace A{}
  int main()
  {
      int A;
  }
  </code></pre>
  
  <p>However [namespace.alias]/4 says the following:  </p>
  
  <blockquote>
    <p>A <em>namespace-name</em> or <em>namespace-alias</em> shall not be declared as the
    name of any other entity in the same <em>declarative region</em>.</p>
  </blockquote>
  
  <p>and  </p>
  
  <p>[basic.scope.declarative]/1 says:  </p>
  
  <blockquote>
    <p>Every name is introduced in some portion of program text called a
    <em>declarative region</em>, which is the largest part of the program in which that name is <em>valid</em>, that is, in which that name may be used as
    an unqualified name to refer to the same entity.  </p>
  </blockquote>
  
  <p>That is, I have the impression that the <code>int</code> variable in <code>main()</code> cannot have the same name as the namespace <code>A</code>. Observe that the example in [basic.scope.declarative]/2 seems to corroborate this when it says  </p>
  
  <blockquote>
    <p>The <em>declarative region</em> of the first j includes the entire example.  </p>
  </blockquote>