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

    <tr>
        <th>Summary</th>
        <td>
            Can not use `ref.static_member` in constant expression
        </td>
    </tr>

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

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

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

<pre>
    https://godbolt.org/z/PfG7e31Kx

```c++
struct Foo {
  static constexpr int value = 1;
};


int main() {
 // OK
    Foo foo;
    static_assert(foo.value > 0);

    // Clang error
    Foo& ref = foo;
    static_assert(ref.value > 0);
}
```

> ```
> <source>:13:19: error: static assertion expression is not an integral constant expression
>    13 | static_assert(ref.value > 0);
>       | ^~~~~~~~~~~~~
> <source>:13:19: note: initializer of 'ref' is not a constant expression
> <source>:12:10: note: declared here
>    12 | Foo& ref = foo;
>       |          ^
> 1 error generated.
> Compiler returned: 1
> ```

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVMuO4yoQ_ZryptSRDbaJF16kk_guenHvH1xhU04YYYgAt3p6Md8-Io_OQ9M9M5ZVRkXBOacORoagd5aoheoZqk0m57h3vrVyslq-Zr1T39t9jIcAfAWsA9btnOqdiQvnd8C6d2Ddf-M_gnjx8gb5BvLVOdb56R2APaf3mA3Rz0PEzjkEcc4hhiijHnBwNkR6O3jUNuKrNDMh8A0WwM-lIDbX8U1M9ZPUFtgSWHOz9Yky_vtygcIj9ujcxz4pdyLwvwyBfAS2HJ1bXPC3mANrHmDTovPeayPtDsl75-9AgNXoaTwq-B2ep_FTPLF5aOidfL7Fx4mU4uvgZj8Q8C3wVcFTaICvzjz56tLzEwXtLKbGUwhpqANaF1HaZATtvDQnb6SNN2VXOEQsOIJY_5Ww08LUSLFGqLY_bp4_kWJdpPTVVkctjX4nj25EYMLTCEx8yPia_CMASyG_BVA0GOlJ4Z483atmR_JfuH2v8uOBanudL06u4I4seRlJLa5zazcdtCGPnuLsLalEqPjU_Ey1XDW8kRm1Rb1sKlEKIbJ9q0iUouqXfSNKSQ0NQ903ZZWLopRESmW6ZTnjuShEXhcNF4uyVkqpoZeiEn0zCihzmqQ2C2Nep_T3ZzqEmdqaNznLjOzJhMst4ttU9NTPuwBlbnSI4bos6mioXUt7dGcOlESkg3I-PBNNPXmoc9T2V9ZlszePd5KO-7lfDG4C1iWg8-fp4N03GiKw7kg2AOuOfH8GAAD__1tTbhE">