This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 118f. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2025-11-30


3139. Temporaries for bit-fields in reference initialization

Section: 9.5.4  [dcl.init.ref]     Status: open     Submitter: Ell     Date: 2025-10-08

Consider:

  struct S {
    int i : 5;
  };
  const int& x = i;

Prior to applying the resolution of issue 2801, this was valid; the reference was bound to a temporary. Now, this is ill-formed.

Suggested resolution:

Change in 9.5.4 [dcl.init.ref] bullet 5.4 as follows: