-Wcomma emits a warning when there is a questionable use of the comma operator. It does this by only allowing certain expressions on the LHS of the comma operator, with all other expressions giving a warning. The current whitelisted expressions are increments, decrements, assignments, compound assignments, overloaded versions of these operators, and void returning functions. Some examples of code that will be detected:
int foo(); if (foo(), 5) {} // should be "==" cout << "foo is " , foo(); // should be "<<" void bar(int); void bar(int, int); bar((foo(), foo())); // Too many parens, calls the one argument function