title: Small typo in my initializer list causes unspeakable pain
body: <p>So, I just got through with a grueling multi-hour debug session of a large server application.  The error eventually came down to a barely noticeable typo in a constructor.  Basically, it was something like:</p>
  
  <pre><code>template &lt;class T&gt;
  class request_handler
  {
      public:
  
      request_handler(T&amp; request, Log&amp; error_log) 
        : m_request(m_request), m_error_log(error_log)
       { 
         /*... some code ... */
       }
  
      ...
  };
  </code></pre>
  
  <p>See the bug?  Well, I didn't.  The problem is a small typo in the initializer list: <code>m_request(m_request)</code> is assigning an uninitialized reference to itself.  Obviously, it's supposed to read <code>m_request(request)</code>.</p>
  
  <p>Now, the member variable <code>m_request</code> is of type <code>T&amp;</code>.  So - is there some reason the compiler didn't warn me that I was using an uninitialized variable here?  </p>
  
  <p>Using GCC 4.6 with the <code>-Wall</code> flag, if I say:</p>
  
  <pre><code>int x;
  x = x;
  </code></pre>
  
  <p>...it will issue a warning: <code>warning: ‘x’ is used uninitialized in this function [-Wuninitialized]</code></p>
  
  <p>So, why didn't the compiler warn me when I assigned <code>m_request</code> to itself: essentially assigning an uninitialized reference to itself?  It would have saved me hours of annoyance.  </p>