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

    <tr>
        <th>Summary</th>
        <td>
            Placement new can modify const-qualified variables
        </td>
    </tr>

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

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

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

<pre>
    Consider:
```c++
namespace std {
  using size_t = decltype(sizeof(0));
}

void *operator new(std::size_t, void *p) { return p; }
void* operator new[] (std::size_t, void* p) {return p;}

constexpr int foo() {
  const int a = 10;

  new ((int*)&a) int(12);

  return a;
}
static_assert(foo() == 12);
```
https://godbolt.org/z/7jj8YsE8r

This should not be accepted of course.

This might be a good first issue, I'm not sure. Maybe @cor3ntin can comment on that.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJx0U8Fu6zYQ_JrVZRGDWlm2fNBBiWughwI99NLTA0WuJAYUqZKUU-frC8pO4xZ4AGEDuzOzO0NKxmhGx9xC_Qr1uZBrmnxoUy9ZcwhF7_WtffMuGs0Bqg5EBwdxPwroNR_ROTlzXKRijEkjHHMNcY3GjRjNJ_9ICNUZNSubbgsDNbnqB6BGAJ3yqTIHjuf8K7qrNxqBOr9wkMkHdPyRWUnnHaruLgr0hl_IBeiUJ2PgtAaHC1SveNfLEKAO_yO22cWfa2bCl-aT5L8bKu9i4r-XgMYlHLwHah7wzfzW33py816Kh8XcdPyBG74xLgF1WwYHmflboSnpO5NMeGwgn2OKSSajfsgYOWTO0w7VeRv5JPJ1ZyC6KaUlZst0AbqMXvfepp0PI9DlE-hyfH9v_oy_NOE-_I_JRIyTX61G5xP2jFIpXhJr9AMqv4bIuyfsbMbpDsPRe42DCTmJGFfO4f4KdJw3pbgG3uFv8tYzwl4oHyqXjEMlHSo_z-wSeodpkmlX6LbSp-okC27L455E2exJFFMre1ntaWhOshSnWvZSVYMs9eF0JNYHNRSmJUG1qMpaHIQgsTvUTX9omESjuSYtYC94lsburL3OOYdi27Utq3JfUWFlzzZu3weRstKNUHVD8C6x00AE9JYb23O4Spsr9bkIbVZ76dcxwl5YE1P81k8mWW5_t1LxZjI_h2x69toMt_vTeflrldYMhjVeZTCytxyLNdj2f9dn0rT2O-VnoEse8Ph7WYJ_Z5WALpubCHR5GLq29E8AAAD__zVRNDw">