title: Why is this a forward declaration in C++?
body: <p>I will have the following code snippet in utilA.cpp:</p>
  
  <pre><code>// utilB.h
  namespace xm
  {
       void zoo(struct tm timeval);  //&lt;-----line 0
  }
  
  
  // utilA.cpp
  #include &lt;utilB.h&gt;                 //&lt;----line 1
  #include &lt;time.h&gt;                  //&lt;----line 2
  namespace xm
  {
       void foo()
       {
           struct tm time1 = {0};    //&lt;----line 3
       }
  }
  </code></pre>
  
  <p>GCC complains when compiling utilA.cpp,</p>
  
  <pre><code>error: variable 'xm::tm time1' has initializer but incomplete type
  </code></pre>
  
  <p>It seems this is because the <code>utilA.h</code> is using <code>struct tm</code> in line 0, but without include the <code>time.h</code>, and the compiler treat the <code>struct tm</code> in line 0 as a forward declare, so the <code>struct tm</code> at line 2 is resolved as <code>xm::tm</code> inside the header at line 0.</p>
  
  <p>So does the C++ standard define this <code>struct tm</code> as an type of function parameter as forward declaration? Please help to explain this and quotes from the standard will helpful.</p>