title: gcc warning "does not declare anything
body: <p>I'm working on updating some C++ code to C+11 by converting typedef's into using aliases. Given the following SCCE:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;linux/cn_proc.h&gt;
  /**
   * Legacy C structure
   */
  struct sample {
    enum what {
      FOO,
      BAR
    } what;
  };
  
  void tdef( ) {
      typedef enum sample::what demo;
      demo a = sample::FOO;
      std::cout &lt;&lt; a &lt;&lt; std::endl;
  }
  
  void usingdemo( ) {
      using demo = enum sample::what;
      demo a = sample::BAR;
      std::cout &lt;&lt; a
      &lt;&lt; std::endl;
  }
  
  int main() {
      tdef();
      usingdemo();
  }
  </code></pre>
  
  <p>I'm getting a warning using the using declaration:</p>
  
  <pre><code>warning: declaration ‘enum sample::what’ does not declare anything
       using demo = enum sample::what;
                                 ^
  </code></pre>
  
  <p>although the code compiles and executes fine. Compiler is <em>g++ (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609</em> Does the fault lie in the compiler, or in me?</p>
  
  <hr>
  
  <p>Thanks for the replies. In regards to the comments about the C struct:</p>
  
  <ul>
  <li><p>The "S" is SCCE is small, so I posted the smallest struct that would
  demonstrate the issue. The actual struct I'm using is "struct proc_event" from
  <a href="https://github.com/torvalds/linux/blob/master/include/uapi/linux/cn_proc.h" rel="nofollow noreferrer">linux/cn_proc.h</a>.  </p></li>
  <li><p>I'm just including it without the "extern C"
  and it's working fine.</p></li>
  </ul>