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

    <tr>
        <th>Summary</th>
        <td>
            clang does not support initializing constant reference member with literal
        </td>
    </tr>

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

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

    <tr>
      <th>Reporter</th>
      <td>
          Ming-3364
      </td>
    </tr>
</table>

<pre>
    The following simple test is currently rejected by clang:

```c++
struct test {
  test() : x(0) {}
  const int &x;
} ;
```
Assigning a temporary value to a corresponding constant reference variable is allowed in C++. Accordingly, the test should be well-formed.

Both GCC and MSVC accept it:

[https://godbolt.org/z/dP7h4dG63](https://godbolt.org/z/dP7h4dG63)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMUs2K4zwQfBr50iTIbSWODz7kB89p4INv2bt-OrYW2TKSnJnM0y9yMswysLAgbKqpVrnKJWO0_UTUst2J7S6FXNLgQ_tqp35TVXtRKG_u7Y-B4Oqd82926iHacXYEiWICG0EvIdCU3B0C_SKdyIC6g3Zy6ll1ZPzC-Odzzx9HMzzls05jCotOj-tY_RzCihkeGDbAqiO8MzzwFdQnVl8-WdpP-SumBAz376x6rrP6Al_gU_YBj6vlbERConH2QYY73KRbCJIHCdqHQHH2k8mkVUFOCQJdKdCkCW4yWKkcZfcyp0IG7ATnh6stHLX2IS-7O8MzpOEZVhz84gwogjdybnP1YSSz_TOhk08DvJzPICcDr___PIPUmuYENn3PcncaUppjHmPHsOu9Ud6lrQ89w-6DYWf-qwdhXvYV210YHv6djk1h2so0VSMLassaUVR1LUQxtPsKhSmp1FwqTeq6F6iwVLJpSJum4YVtkaPgdVWWYrcTYqs4N0oJXh40acMPTHAapXVb525jli9sjAu1JS8rURdOKnJxrSPio0SIuZmhzQsbtfSRCe5sTPHrimSTo3alg_EUYfIJ4jLPPuR22GSlsx9_-Z0jjYoCvNk0gLOJgnTFElz7LTCbhkVttR8Zdln4-drMwefaM-xWI5Fh9_Rya_F3AAAA__8OQQ0n">