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

    <tr>
        <th>Summary</th>
        <td>
            `[[assume(++a)]]` warns that the side-effects will be discarded, but they are not discarded at compile time
        </td>
    </tr>

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

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

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

<pre>
    ```c++
constexpr int a() {
  int a = 0;
  [[assume(++a)]];
  return a;
}
static_assert(a() == 1);

#include <iostream>

int main() {
  std::cout << a() << "\n";
}
```

This code prints `0`, even though the `static_assert` doesn't fail. Clang does print a warning about the side-effects of `++a` being discarded, but that is not true at compile time.

CC @Sirraide 
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyEUs1u4zgMfhr6QjSQJctJDj608eYFdu8L2WJsLWwpkOh2-_YDyUXamQ4wAGFZ_PnI7xNNSm7yRB3oF9B9ZTaeQ-x4MGQpxmoI9r2DVuw2gnzJJnoQz2Pwien_e0TnGQ3IE8gzwvEjjLsbQfUoQD28pdGLSWlbqdRkRAPyDLrP9pkZibfo0TxccOz3n8SG3fivSYkigzw9mqs-t6sz2qNo_0rl_LhslhDUxYXEkcwK6q-vSXng1Tj_nUpiC-oZ1PMYNs4IoC6flPcrSAn64vPxbeCHgl_b_TO7hGOwhPfoPCeEVpQceUF6JY88h22akWfKoZ9JtwJtoORBHhlvxi0HvCzGT8W7A6LBNxO98xOaIc-dgZKz9ES3G42cMNyw9NufoBU4UM62Lo0mWrJ5kqEUGkaX0AdGjhuhYRzDencLIbuVDl9pXS4IjfjbxWicJaxsp-xZnU1FXX2shT7XSslq7mqhSeiBGlkLW6tWN41WulHN0Wh1a8bKdVLIRqi6rWWtZXuoTXuqRaOH4XQkZRU0gtZMfVle10OIU-VS2qg7aV2fq8UMtKSy2FJ6esMSLK_UV7HLNU_DNiVoxOISp08UdrxQ2fo_7GorisJpF-ibvG9uWXCg3-lJ72giFUEf0V9Vrba4dDPzPeXdk1eQ18nxvA2HMawgr3nej-PpHsN_NDLIa2GZQF6LCj8CAAD__7DFIqc">