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

    <tr>
        <th>Summary</th>
        <td>
            Improve diagnostic of `static_assert(requires [...])`
        </td>
    </tr>

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

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

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

<pre>
    When a static assert over a requires expression fails, clang gives no insight as to how the requires expression was evaluated, it just shows the line literatim.

Clang does gives reasonable diagnostics when the same requires expression evaluation causes a constraint failure. I have hope that this mechanism can be leveraged for `static_assert` too

Testcase https://godbolt.org/z/fnoW3aMM9
```c++
#include <concepts>

int g(int);

#if 0
// This diagnostic is reasonable
template<typename T>
    requires requires (T t)
    {
 { g(t) } -> std::same_as<void>;
    }
void f()
{}

#else

template<typename T>
void f()
{
    // This diagnostic is no good
    static_assert(requires (T t)
    {
        { g(t) } -> std::same_as<void>;
    });
}
#endif

void test()
{
 f<int>();
}
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJykVMFu4zYQ_ZrxZRCDIm1HOuhgOzGwBRboIcAeF5Q0krigSFczkpt-fUHJ3aTbtD2sQZgUyXlv3huSltl1gaiE_Qn2Txs7SR_H8tdfTvF1U8XmtfzSU0CLLFZcjZaZRsE404gWR_ptciMx0u_XkZhdDNha5xn0GWtvQ4edm4kxRHSBXdcLWkaJ2McbSk8fItwsI83WT1aoSUhO8NvEgtzHGy9h3oX0JzRaccMW1BHU8bwQNpH4zjqS5Rhs5QkbZ7sQWVzNeEuKEgrb4eMM7uxpWNuJidFiHQPLaF2QReI00hY_YW9nwj5eCaW3gtI7xoHq3gbHA9Y2YEXoaabRdtRgG0eEg1rN_LqaCQeFEuOq4YVYasuEvciVwRxBX0BfuthU0cs2jh3oyx-gL22IX4z9_LlIcQe1thr0KTV1BG1cqP3UEII51zHUdBUG87zSJBUd6NwFAV2AOa3TKapFtYwSLb4kPW_eoXtvKqij0HD1VgjMWV6vFJKhLysLIr55-30AOn_BhXPdAY-JOnVLPmkF4fEJH8A8I0uTHDDHVKivlsGc5-iahL9kvAI8gTqmaWxB5ytyQl3mV03kmdaP_8j3A4g7w79aESJ2MTb3fX8vqs7_T_P993PSvxdvlasNhca1q9hFkRDLj6JaMOdUefN8X3kP8ddZ2jSlaQpT2A2V2eOuyDN1KIpNXz7me9rXTaXyrGjNI7VZm7cqb9TBFpRRtXGlVnqvDpnJlMlMsW12eZMpq6pa7TMyFnaKBuv81vt5SGd645gnKrPdTu3NxtuKPC8vktaBbrisgtbpgRrLFPRQTR3DTnnHwm8w4sRT-Wm4jnF-f-cxtv-8du8rtD9tt1vYL34e1GYaffnDBXTST9W2jgPoS-K7dw_XMX6jWkBfliwZ9OUuYy71nwEAAP__opupIQ">