title: C++ enum not properly recognized by compiler
body: <p>Can anyone explain why the following code does not compile (on g++ (GCC) 3.2.3 20030502 (Red Hat Linux 3.2.3-49))?</p>
  
  <pre><code>struct X {
  public:
     enum State { A, B, C };
  
     X(State s) {}
  };
  
  int main()
  {
     X(X::A);
  }
  </code></pre>
  
  <p>The message I get is:</p>
  
  <p>jjj.cpp: In function 'int main()':<br>
  jjj.cpp:10: 'X X::A' is not a static member of 'struct X'<br>
  jjj.cpp:10: no matching function for call to 'X::X()'<br>
  jjj.cpp:1: candidates are: X::X(const X&amp;)<br>
  jjj.cpp:5:                 X::X(X::State)`  </p>
  
  <p>Is this bad code or a compiler bug?</p>
  
  <p>Problem solved by Neil+Konrad.  See the comments to Neil's answer below.</p>