title: Why does this code produce a warning referring to the comma operator?
body: <p>When answering <a href="https://stackoverflow.com/q/5665221/27615"><strong>this question</strong></a>, I came across this code...</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  int main()
  {
      int const income = 0;
      std::cout &lt;&lt; "I'm sorry your income is: " &lt; income;    // this is line 6
  }
  </code></pre>
  
  <p>...which contains a typo. The second (intended) <code>&lt;&lt;</code> operator on line 6 has been accidentally written as a <code>&lt;</code>. </p>
  
  <p>That aside, compiling the code <a href="http://ideone.com/RRMY0" rel="nofollow noreferrer">using GCC 4.3.4</a> or 4.4.3 results in a warning:</p>
  
  <pre><code>prog.cpp: In function ‘int main()’:
  prog.cpp:6: warning: right-hand operand of comma has no effect
  </code></pre>
  
  <p>My question: why is that particular warning produced? Which comma operator is it referring to? </p>
  
  <p><strong>NOTE: I'm not advocating deliberately using a single <code>&lt;</code> in a <code>cout</code> statement.</strong>  I merely stumbled across this warning while trying to figure out an answer to the other question I've linked to, and am curious as to why the compiler generates it. </p>