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

    <tr>
        <th>Summary</th>
        <td>
            Clang C++23: P1847R4 may need some changes
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

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

    <tr>
      <th>Reporter</th>
      <td>
          frederick-vs-ja
      </td>
    </tr>
</table>

<pre>
    The following code is currently rejected by clang when compiled with `-std=c++2b` ([godbolt link](https://godbolt.org/z/vfGfcx1ae)).

```C++
class A {
    int a;
public:
    int b;

    constexpr const int* addr_a() const { return &a; }
    constexpr const int* addr_b() const { return &b; }
};

constexpr A x{};
static_assert(x.addr_a() < x.addr_b());

int main() {}
```

As [P1874R4](https://wg21.link/p1874r4) has specified the order of allocation of member subobjects with different access controls, the result of `x.addr_a() < x.addr_b()` is no longer unspecified (required to be `true`).

Perhaps the discussion shown in [CWG2368](https://cplusplus.github.io/CWG/issues/2368.html) means that this code is ill-formed in C++17/20, and well-formed in C++23...
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyNVMFuozAQ_RpzsYLAkAAHDmmi9lpVK-2xss0Abg1mbdMk-_U7TmjTVNXuRsbB4-eZN-M3CNOc6h890NZobQ5q7Kg0DVDlqJythdHrE7XwAtJDQ8WJSs0Rc-hhROAwKY3mg_I9JZtk5XxDsr0k7A4HE2iihJVkfdeZRhjtqVbjK1nv0dh7PzmSbQm7x7Hsx8Z2uPqNz1v70MpjyoGwCkdMkj1Jtsu8SS5jd4l0sSIz5-iWkmIxUPyp0VNOssUyzUIrGaLeAMQH4GqXZnQejpO9vAUcYVvKm8Y-85AUq5YdjIcV8rMdMdlNCIam_f95En_xJG48hZdblle_W3oMSX9COM-9ks9YELAYrTzGN8RJtqOLaWEQxq37UJiBq_H9yCXAbf0_47eO4kU_pmWRP-Xf3fGhY2l8FgC7nwLM5sFxzx11E0jVKpSSRyka24ClpqUcJSkxETOG1QCDQLubhRFBj-6iu0a1LQShUi4loAKwLt4a7Qjbnd1ZcDNKDz0g438XAjWL4h8N1WbsMN48XtkhxMKvWdnA1FABwaW3M4RafBHpI9ieT-5MoVFOzs6FRFxvDiNqIBRr9_OBZZvyu2LJSc8uPHGHSc4iVgateABn5dwMmN59OBz3ftAhlQH4GKJxj1No36WNldar1tgBKWPUpWPSIhxPQon4iA0M34FYFsdx1NRZU2UVj7zyGurduf8_EEiY4p3nxVOOajnREdCFMwNQ2SMQXDRbXX9p9ktG-PnAhdZv73-ryZpwsZ9TXOdZmUZ9zUqeN6JiAEnJsoKxZNNUyaZqsqzIinQdaS5AuxqriuWMVM0SxGTpOkmzZF3FUGS8kFKUTOZJuxYkTwDVreMQOHx2IlufOYi5c7iplfPuuomNpDrM7d0_n31vbN2iEMAq-bp6c6sXHp1p12fOfwArSJxN">