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

2024-10-26


1261. Explicit handling of cv-qualification with non-class prvalues

Section: Clause 7  [expr]     Status: CD3     Submitter: Nikolay Ivchenkov     Date: 2011-03-12

[Moved to DR at the October, 2012 meeting.]

Proposed resolution (December, 2011):

  1. Change 7.2.1 [basic.lval] paragraph 4 as follows (supersedes the corresponding change in the resolution of issue 1059):

  2. Class prvalues can have cv-qualified types; non-class prvalues always have cv-unqualified types. Unless otherwise indicated (7.6.1.3 [expr.call]), prvalues shall always have complete types or the void type; in addition to these types, glvalues can also have incomplete types. [Note: class and array prvalues can have cv-qualified types; other prvalues always have cv-unqualified types. See Clause 7 [expr]. —end note]
  3. Add a new paragraph following Clause 7 [expr] paragraph 5:

  4. If an expression initially has the type “reference to T”...

    If a prvalue initially has the type “cv T,” where T is a cv-unqualified non-class, non-array type, the type of the expression is adjusted to T prior to any further analysis.

  5. Change 7.6.1.3 [expr.call] paragraph 3 as follows:

  6. If the postfix-expression designates a destructor (11.4.7 [class.dtor]), the type of the function call expression is void; otherwise, the type of the function call expression is the return type of the statically chosen function (i.e., ignoring the virtual keyword), even if the type of the function actually called is different. This return type shall be an object type, a reference type or the type cv void.
  7. Change 7.6.1.4 [expr.type.conv] paragraph 2 as follows:

  8. ...[Note: if T is a non-class type that is cv-qualified, the cv-qualifiers are ignored discarded when determining the type of the resulting prvalue (7.2.1 [basic.lval] Clause 7 [expr]). —end note]
  9. Change 7.6.3 [expr.cast] paragraph 1 as follows:

  10. ...[Note: if T is a non-class type that is cv-qualified cv-qualified, the cv-qualifiers are ignored discarded when determining the type of the resulting prvalue; see 7.2.1 [basic.lval] Clause 7 [expr]. —end note]