title: C++11 Accessing Unscoped Enumerators with Qualified Name
body: <p>I have a question about the wording of the C++11 standard as I have not had to dig into it frequently in the past and recently found myself confused on the (admittedly unimportant) topic of unscoped enums.</p>
  
  <p>I recently came across some code in a code review that was using an unscoped enum but accessing the enumerators using fully qualified names, like this:</p>
  
  <pre><code>enum SomeEnum
  {
    EnumA,
    ...
  };
  
  void foo()
  {
    SomeEnum x = SomeEnum::EnumA;
  }
  </code></pre>
  
  <p>I was certain that this didn't work and that SomeEnum had to be an enum class for this behavior, but, sure enough, it compiled cleanly.</p>
  
  <p>Peeking into the C++11 standard, I at first thought that the standard agreed with me:</p>
  
  <blockquote>
    <p><strong>§ 7.2 Enumeration Declarations:</strong> Each enum-name and each unscoped
    enumerator is declared in the scope that immediately contains the
    enum-specifier. Each scoped enumerator is declared in the scope of the
    enumeration.</p>
  </blockquote>
  
  <p>This appears to me to indicate that unscoped enumerators are declared only at the immediately containing scope of the enum itself. It doesn't mention that they are also declared at the enumeration scope.</p>
  
  <p>However, a little further down, the standard does include an example that shows accessing an unscoped enumerator using the fully qualified name.</p>
  
  <p>A quick bit of googling and searching on SO gave me a small number of places that assert that the standard does now allow the fully qualified name, but there isn't much discussion. Is this just weak wording in the spec that is clarified by the example, or is there something else I'm missing?</p>
  
  <p>Again, this isn't earth shattering, but I'm hoping someone can set me straight on my reading of the standard and I can learn something that may be useful in a future situation.</p>