title: Why does a function declaration within another function compile and what does it do?
body: <p>I intended to call a private class member function, but by a copy&amp;paste mistake pasted the line as this function is declared in the header file:</p>
  
  <pre><code>void DebugView::on_cbYAxisEnabled_stateChanged(int)
  {
      void updateAxisEnabled();
  }
  </code></pre>
  
  <p>instead of</p>
  
  <pre><code>void DebugView::on_cbYAxisEnabled_stateChanged(int)
  {
      updateAxisEnabled();
  }
  </code></pre>
  
  <p>Surprisingly, the code was compiled and executed. However the method <code>updateAxisEnabled()</code> was not executed.</p>
  
  <p>So, why does it compile? Was here a local function declared within a method body or has <code>void</code> instructed the compiler to ignore whatever comes afterwards?</p>
  
  <p>The compiler is Visual&nbsp;Studio&nbsp;2008.</p>
  
  <p>P.S.: I'm aware of class declaration/definition within functions, but not functions within functions in C++.</p>