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

    <tr>
        <th>Summary</th>
        <td>
            [clang] Forbidden implicit conversion of constraint expression to bool
        </td>
    </tr>

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

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

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

<pre>
    clang (any version) currently accepts any expression that can be implicitly converted to bool in require-clause parenthesized expressions. I first thought this is correct and gcc is wrong in not accepting any constraint expression which does not have type bool.

Searching the C++ standard [[temp.constr.atomic]](https://eel.is/c++draft/temp.constr.atomic). The example given in [13.5.2.3.3](https://eel.is/c++draft/temp.constr#atomic-3) does indeed compile using clang although the standard clearly states that it is an error. gcc correctly reports the error "constraint expression does not have type 'bool'".

Link to example from C++ Standard in Compiler Explorer: https://godbolt.org/z/5zh6dcT8v
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJydU01v3CAQ_TX2ZRTLC3aye_AhH41UqbfkD2AY26QYXMCbbH59B7xJmiq9VMLGwPDmzXvj3qlTJ42wIxRsL-wJjuiDdrZgB5Cr92ijOYGQEpcYIAXgy-IxpBiIk4gghYUeQc-L0VKnaOksoURUEB30zhnQFjz-WrXHC0q2BoRFJOgJg36luA_MUMF3GLQPkdDdOk5p1gFoSEd0ZCQSCkYp09azd8Sc0K2LZ5KaNhJNIhGiF9rGPxk_T1pOoByGfGUSR4R4WjDTrIr6rqivt_cDCi-nhEYs4bZgNzQgRMouvIKivaERcV6qLVMlopu1LNq7NNh-inEJBb8u2D0NRFPpQB9yA1JeDJGWXwCwQwWPlBJfBEmKMOoj2lQj5dvxqq1YxSv-n0kKxrc0Fzw5nIXQViF5IN28aMq3hlT01hPCbCZkDd5rl4a0IZ9pI9L93AU6Jj-oFdB756ts0NkwivS4OB9DhskB1G3sa4e-8KZgV8kemujWJ5N-aPszNdmbVoN387tXD298SbvbrTgP314W4zx6Eg0-qzc61TsTK-dHWr3S075Ol0o-7o-l6rg68IMoIzU4duRE1odMgHvne61Usuj8B5z7P1fjhn804vnPKFdvur946DitPfk108KY49t0sXj3RHLSUoewYjK6bVrWlFPXYt_zVg1NgxyV5Lur9vJS9cgGJgbG96URPZqQiJOEFp8hQ9A3lVDqjtWM1Zw1u7qum7ZC2e6EUHI3sJbvr3ZFU-MstKkSjyRQ6btMqV_HQIdGhxg-DgWVOFrMOiV8sVIX-W55GjEd59Rdpv4bxTaGxQ">