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


2006. Cv-qualified void types

Section: 6.8.4  [basic.compound]     Status: CD4     Submitter: Richard Smith     Date: 2014-09-16

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

According to 6.8.4 [basic.compound] paragraph 3,

The type of a pointer to void or a pointer to an object type is called an object pointer type. [Note: A pointer to void does not have a pointer-to-object type, however, because void is not an object type. —end note]

This wording excludes cv-qualified void types. There are other references in the Standard to “void type” that are apparently intended to include cv-qualified versions as well.

Proposed resolution (May, 2015):

  1. Change 6.8 [basic.types] paragraph 5 as follows:

  2. ...Incompletely-defined object types and the void types cv void are incomplete types (6.8.2 [basic.fundamental])...
  3. Change 6.8 [basic.types] paragraph 8 as follows:

  4. An object type is a (possibly cv-qualified) type that is not a function type, not a reference type, and not a void type cv void.
  5. Change 6.8.2 [basic.fundamental] paragraph 9 as follows:

  6. The void type has an empty set of values. The A type cv void type is an incomplete type that cannot be completed; such a type has an empty set of values. It is used as the return type for functions that do not return a value. Any expression can be explicitly converted to type cv void (7.6.3 [expr.cast]). An expression of type cv void shall be used only as an expression statement (8.3 [stmt.expr]), as an operand of a comma expression (7.6.20 [expr.comma]), as a second or third operand of ?: (7.6.16 [expr.cond]), as the operand of typeid, noexcept, or decltype, as the expression in a return statement (8.7.4 [stmt.return]) for a function with the return type cv void, or as the operand of an explicit conversion to type cv void.
  7. Change bullet 1.3 of 6.8.4 [basic.compound] as follows:

  8. Change 6.8.4 [basic.compound] paragraph 3 as follows:

  9. The type of a pointer to cv void or a pointer to an object type is called an object pointer type. [Note:...