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

    <tr>
        <th>Summary</th>
        <td>
            Clang gives a different answer for __builtin_constant_p than GCC
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            c,
            clang:frontend
      </td>
    </tr>

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

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

<pre>
    Consider the following C code:
```
_Static_assert(__builtin_constant_p((1,2)), "what?");
```
In Clang, the static assertion fails and in GCC the static assertion passes. C disallows comma operators explicitly as constant expressions, and Clang does get that correct in some cases:
```
_Static_assert((1, 2), "what?");
```
In both Clang and GCC the static assertion fails (as it should): https://godbolt.org/z/odTKMrqWe
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyVkk2L2zAQhn-NfREbHMkf8cGHxEtKKT210KORJdlWUSSvNN50--s7UrIUyi5sQcb6nPedZ2Z08qXrnQ1aKk9gUWRyxrirtjPpiXBSZeyYFY9Zcczq4j7ScvgGHLQYeAjKQ0YPwzBu2oC2g8B4wC0MK27j2Ge0pxlt0-hJRul14ZCxM87iHju9qfDZkt5wO8c30VlIguQmqJ0lE9cmEG4l0ZZ86t-5tcZp2GE6UgcekwuY2OXCiVuV5-B8IOrXarTQYF7wIXn1H7e9CgGjhGgiKiVHRDoVyKwAFTngfe-VgOgiuIsigqPgh7ndARH6_3hGB8vdUfT2LoIbKBTC5DSQsLjNyBT6SBaANZmlqHeenRydgZ3ziP38Gz8nv3_56p9-qFx2TLas5TkgKNXddGf9jCg4sp0m5RVC4zZcsZcm58lbLRGRpWrlmzfdP-oalm3cYXVwYczz6-9h9e4nEsalDmFDuPRcVW1Z50vXHhrFG9mUrSgP-7oqGsnRiqhbQSUrD7nhozKhy6oT8hSJaYIsUm-x4-SdBWVlPKkec93RgtKiLg77pir2bMcZa8qKNYXYq5qVNCsLdUGgu-gsgsp9l0yO2xzw0OgA4e8hVkHPVqlkAOPzDRbnuyNH2RO244XbPCXVpYz-ABVuIQk">