<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/57151>57151</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            -Wcomma is emitted for void returning functions
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          gpakosz
      </td>
    </tr>
</table>

<pre>
    Hello,

While experimenting with `-Wcomma` and looking for its documentation, I landed on https://reviews.llvm.org/D3976, which says

> The current whitelisted expressions are increments, decrements, assignments, compound assignments, overloaded versions of these operators, **and void returning functions**

However, the [following repro](https://godbolt.org/z/Wa8qxKv8j) shows that it's not the case:
```
void foo()
{
}

int bar(int i)
{
  return i;
}

int main(int argc, char* argv[])
{
  if (foo(), bar(argc))
    return 0;

  return -1;
}
```

```
<source>:13:12: warning: possible misuse of comma operator here [-Wcomma]
  if (foo(), bar(argc))
           ^
<source>:13:7: note: cast expression to void to silence warning
  if (foo(), bar(argc))
      ^~~~~
      (void)( )
1 warning generated.
```

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJydVEtzozAM_jVw0TQD5n3gkDbtdGevO9OzMQLcAs7aJrT761cGmqavSzME_JA-f_osqVL1S3mPfa88duMFBy_Yr--HTvYI-HxELQccrRxbmKXtwEuDqwehhoHTCPhYQ6_Uk9tulAZpDdRKTM6FW6lGgoVf0JMd1qBG6Kw9Gi_ae-yOHo0nibPZ9f1p2Cnd0tIhKrLUec2dFB0Y_mIueXnRLfzpEMSkNZ3hrCz20liCJ7YajaFTDXCNIEeh0TExDq_Gyxknu3Y8Tymgo5oomA_r6oS6V9yRp9EKrRqwHRoEReJwq_Ri6TGKae_0OClZg0Y76XGRZRqFU8KsFpfB3KsZCda5EyJ4yXWj6Cpm56bxqJWXHDyWv9esVXWlervJ9Y_-Dzz_-_z7lD96rADTqdkQHLd0GR7LDIzKLvCCG3QoK4E02J5lunBuFGVBTiCbSXb9OjhcspYke8WJde5G8rM9bNHTXvQ9xMDluGFw3YrlFjoHu3fzE4mxRP8ZXDYkdv5GlhxXOitMcfYBODMJ3pi8p3gVfsHxvTZfL0Y3Rk1akKK3JGoYuRejF8x8uXc3PCrKporqaJBmcgnTwFI558yBDvVy768llRx-FOX285Lb79lljhHlgssBlwv2ol7AqjVt6Wuo8EeB5zh-xsdRyS6eyy2Wu7MWnxzOfuHridDi6OTBevel9D6WYZoGSZqlRezXZVQXUcF9K22P5SYkSAM4SOvagutL39WkP-m-_FBf1OWmakcwNHGNaftcUT0-oqCaupPGTEj1fJdkYRL6Xdk0MYvjrBBVlaZZHLM6iLM6IlqC57zK_Z5X2JvSJTVjI86wQNCYbtyXJQsYC3LCYnEeRrukECKMQxEzjqyqai8OkMqlP_dJX5cLpWpqDW26_vfWRP21hyGWaw35fLKd0mV75E_K_POXo8uF-n-BYMlv">