A RetroSearch Logo

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

Search Query:

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

CWG Issue 1571

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

2025-08-11

1571. cv-qualification for indirect reference binding via conversion functionSection: 9.5.4  [dcl.init.ref]     Status: CD4     Submitter: Michael Wong     Date: 2012-02-06

[Moved to DR at the November, 2014 meeting.]

In the case of indirect reference binding, 9.5.4 [dcl.init.ref] paragraph 5 only requires that the cv-qualification of the referred-to type be the same or greater than that of the initializer expression when the types are reference-related. This leads to the following anomaly:

  class A {
  public:
    operator volatile int &();
  };
  A a;

  const int & ir1a = a.operator volatile int&(); // error!
  const int & ir2a = a; // allowed! ir = a.operator volatile int&();

Is this intended?

Notes from the April, 2013 meeting:

CWG felt that the declaration of ir2a should also be an error.

Proposed resolution (February, 2014):

Change 9.5.4 [dcl.init.ref] paragraph 5 as follows:

A reference to type “cv1 T1” is initialized by an expression of type “cv2 T2” as follows:

This resolution also resolves issue 1572.


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