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

    <tr>
        <th>Summary</th>
        <td>
            Mutable subobject is usable in a constant expression
        </td>
    </tr>

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

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

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

<pre>
    This program
```
struct S {
 mutable int i = 2;
};

auto f = []{
    constexpr S s;
    s.i = 3;
    return s.i;
};

static_assert( f() == 3 );
```
is rejected by GCC, following the word of C++20 standard: https://timsong-cpp.github.io/cppwp/n4861/expr.const#4.8

But Clang accepts this program. Online demo: https://gcc.godbolt.org/z/T9vPKrGnv

Could you please verify whether it is correct?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx8Uk2PozgQ_TXFpdSIlAOBA4dOIvqwWu1K3feVsSvglWMj2yST-fUjSDTpnpFGQnz4Ua9e1XsyRjM45hbKPZTHTM5p9KHtWIes9_rWfowm4hT8EOQZiiMUr1AVj2v9jCnMKuE7wm5_P8HznGRvGY1LaBDEEQnEA4Td8fm-3uWcPJ7W3-4inkSIqLyLib9NAd8x_qxckJjfucWX08BpDm4B_9AyJpmM-k_GyCEB1XgCqoGahW-lRKDmWfN1YBMx8P-sEmvsb_h2OAAd8OSt9VfjBkwj49UHjf6EB6A90J4KjEk6LYMG8YpjSlME8QrUAXXJnKN3w4uapnwwaZz73HigTk3TdQLq3LauNkDdsoR8XQeQ2Ob154H2c8KDlW5AqRRPKWL65FuO_zhrHKPms_9dwKBUPnjde5tyHwag7jtQ99Fc_v0rvLnL5z4HP1uNNz_jZFlGxgsHc7rhdeQ0ckCT0ERUPgRWCUSX6VboRjQy43ZT1XVZN-WuysaWuFK9rESluCh10xeStBTl9lSqgppNn5mWChLFriipEI2oct5uuOwb3exKKZSuYVvwWRqbW3s5L7ozE-PMbSWqpsys7NnGNdVEjq-4gkC0hDy0S81LPw8RtoU1McUnSzLJcvv3I8Jx7n2_mL3MNcdHrFHecyldwsUWjtF4l83Btr-s9u6n8megbmnxeLxMwS-sQN0qLAJ1q_AfAQAA__9zMRMb">