A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://cplusplus.github.io/CWG/issues/1295.html below:

CWG Issue 1295

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

2025-04-13

1295. Binding a reference to an rvalue bit-fieldSection: 9.5.4  [dcl.init.ref]     Status: CD3     Submitter: Nikolay Ivchenkov     Date: 2011-04-14

[Voted into the WP at the February, 2012 meeting; moved to DR at the October, 2012 meeting.]

Consider the following example:

  struct X {
    unsigned bitfield : 4;
  };
  int main() {
    X x = { 1 };
    unsigned const &ref = static_cast<X &&>(x).bitfield;
  }

According to 9.5.4 [dcl.init.ref] paragraph 5, ref is bound to the bit-field xvalue.

Proposed resolution (August, 2011):

Change the indicated sub-bullet of 9.5.4 [dcl.init.ref] paragraph 5 as follows:


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4