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

    <tr>
        <th>Summary</th>
        <td>
            [clang] New static_assert message is sometimes redundant
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            enhancement,
            good first issue,
            clang,
            clang:frontend
      </td>
    </tr>

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

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

<pre>
    The new `static_assert` message is great, there are some simple messages where an expansion isn't particularly helpful.

For example
```cpp
constexpr auto is_gitlab = false;
constexpr auto is_weekend = false;

static_assert(is_gitlab or is_weekend);
```
will give us
```
<source>:4:1: error: static assertion failed due to requirement 'is_gitlab || is_weekend'
static_assert(is_gitlab or is_weekend);
^             ~~~~~~~~~~~~~~~~~~~~~~~
<source>:4:25: note: expression evaluates to 'false || false'
static_assert(is_gitlab or is_weekend);
              ~~~~~~~~~~^~~~~~~~~~~~~
```
The note isn't necessary, since the error implies that the expression will be `false or false`. I noticed that if we change the expression to a conjunction, we get a simpler message, so it looks like the machinery might already be present.
```
<source>:4:1: error: static assertion failed due to requirement 'is_gitlab'
static_assert(is_gitlab and is_weekend);
^             ~~~~~~~~~
```

We should---on a best effort basis---aim to eliminate expansions that don't add value to minimise user frustration (this will give us slightly more room to have longer diagnostics elsewhere).
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy9VU1v4zYQ_TXSZRBD0Zetgw7ZfAB76alAjwtKHElMKNJLUnH97_soretkkQW63aIGRZlfo3lv3gw7K8_t7xOT4RMldeaDCKr_IrxnFzCmmb0XI5PyNDoWIcnvKUzsmAQeb2d0aj5qvuz0dNqWDfGfR2G8sganTZLvAx2Fg_lFC6fPNLE-DoveJdlDkt1t_ZN1OCaiwW_Tdba1_njcZnprfIBpR2IJFqa_jCpo0VFSPNAgtOek-PSjrSfmFzbyg71b_x5_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