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

2024-05-06

[Accepted as a DR at the June, 2021 meeting.]

According to the definitions in 6.8.2 [basic.fundamental], the arithmetic types include only the non-cv-qualified versions. In the taxonomy of fundamental types, the first mention of “cv-qualified versions of these types” is for scalar types (6.8 [basic.types] paragraph 9). However, 7.6.1.6 [expr.post.incr] paragraph 1 and 7.6.2.3 [expr.pre.incr] paragraph 1 both say:

The type of the operand shall be an arithmetic type other thancvbool, or...

which is a contradiction, since cv-qualified `bool`
is not an arithmetic type. Similarly, 7.6.19 [expr.ass] paragraph 6
requires an arithmetic type for `+=`
and `-=`. D.4 [depr.volatile.type] deprecates
the increment and decrement operators when applied to
volatile-qualified arithmetic types, but the wording already
made those ill-formed (since the normative wording requires
an arithmetic type and not a possibly cv-qualified version
thereof).

A related question is whether 12.5 [over.built], which explicitly allows for cv-qualified arithmetic types, should also note the deprecation.

See also issue 2185.

**Notes from the July, 2020 teleconference:**

CWG felt that no changes should be made to 12.5 [over.built].

**Proposed resolution (April, 2021):**

Change 6.8.2 [basic.fundamental] paragraphs 11 and 12 as follows, splitting paragraph 12 as indicated:

Change 6.8.5 [basic.type.qualifier] paragraph 1 as follows, splitting the paragraph as indicated:

A

*const object*is an object of type`const T`or a non-mutable subobject of a const object.A

*volatile object*is an object of type`volatile T`or a subobject of a volatile object.A

*const volatile object*is an object of type`const volatile T`, a non-mutable subobject of a const volatile object, a const subobject of a volatile object, or a non-mutable volatile subobject of a const object.Change 12.5 [over.built] paragraphs 2-10 as follows:

Types

bool,char,wchar_t,char8_t,char16_t,char32_t, and the signed and unsigned integer types, and cv-qualified versions (6.8.5 [basic.type.qualifier]) thereof, are collectively~~called~~termedintegral types. A synonym for integral type isinteger type. [Note 8:Enumerations (9.7.1 [dcl.enum]) are not integral; however, unscoped enumerations can be promoted to integral types as specified in 7.3.7 [conv.prom]. —end note]

~~There are~~The three distinct typesthree floating-point types:float,double, andlong doublecan represent floating-point numbers. The typedoubleprovides at least as much precision asfloat, and the typelong doubleprovides at least as much precision asdouble. The set of values of the typefloatis a subset of the set of values of the typedouble; the set of values of the typedoubleis a subset of the set of values of the typelong double. The typesfloat,double, andlong double, and cv-qualified versions (6.8.5 [basic.type.qualifier]) thereof, are collectively termedfloating-point types. The value representation of floating-point types is implementation-defined.[Note 9:This document imposes no requirements on the accuracy of floating-point operations; see also 17.3 [support.limits]. —end note]Integral and floating-point types are collectively

~~called~~termedarithmetic types. Specializations of the standard library templatestd::numeric_limits(17.3 [support.limits]) shall specify the maximum and minimum values of each arithmetic type for an implementation.

~~A type mentioned in 6.8.2 [basic.fundamental] and 6.8.4 [basic.compound] is a~~Each typecv-unqualifiedtype.~~which is a cv-unqualified object type or is~~other than a function or reference type is part of a group of four distinct, but related, types: avoid(6.8 [basic.types]) has three corresponding cv-qualified versions of its typecv-unqualifiedversion, aconst-qualifiedversion, avolatile-qualifiedversion, and aconst-volatile-qualifiedversion.~~The type of an object (6.7.2 [intro.object]) includes the~~The types in each such group shall have the same representation and alignment requirements (6.7.6 [basic.align]). [cv-qualifiers specified in thedecl-specifier-seq(9.2 [dcl.spec]),declarator(9.3 [dcl.decl]),type-id(9.3.2 [dcl.name]), ornew-type-id(7.6.2.8 [expr.new]) when the object is created.Footnote:The same representation and alignment requirements are meant to imply interchangeability as arguments to functions, return values from functions, and non-static data members of unions. —end footnote] A function or reference type is always cv-unqualified.

~~The cv-qualified or cv-unqualified versions of a type are distinct types; however, they shall have the same representation and alignment requirements (6.7.6 [basic.align]).~~[^{40}Note:The type of an object (6.7.2 [intro.object]) includes thecv-qualifiers specified in thedecl-specifier-seq(9.2 [dcl.spec]),declarator(9.3 [dcl.decl]),type-id(9.3.2 [dcl.name]), ornew-type-id(7.6.2.8 [expr.new]) when the object is created. —end note]

In this subclause, the term

promoted integral typeis used to refer to those cv-unqualified integral types which are preserved by integral promotion (7.3.7 [conv.prom]) (including e.g.intandlongbut excluding e.g.char). [Note 2:In all cases where a promoted integral type is required, an operand of unscoped enumeration type will be acceptable by way of the integral promotions. —end note]In the remainder of this subclause,

vqrepresents eithervolatileor no cv-qualifier.For every pair (

T, vq), whereTis~~an~~a cv-unqualified arithmetic type other thanboolor a cv-unqualified pointer to (possibly cv-qualified) object type, there exist candidate operator functions of the form

vq T& operator++(vq T&);

Toperator++(vq T&, int);

~~For every pair (~~T, vq), whereTis an arithmetic type other thanbool, there exist candidate operator functions of the form

vq T& operator--(vq T&);

Toperator--(vq T&, int);

~~For every pair (~~T, vq), whereTis a cv-qualified or cv-unqualified object type, there exist candidate operator functions of the form

T*vq& operator++(T*vq&);

T*vq& operator--(T*vq&);

T*operator++(T*vq&, int);

T*operator--(T*vq&, int);For every

~~cv-qualified or cv-unqualified~~(possibly cv-qualified) object typeTand for every function typeTthat has neither cv-qualifiers nor aref-qualifier, there exist candidate operator functions of the form

T& operator*(T*);

~~For every function type~~Tthat does not have cv-qualifiers or a ref-qualifier, there exist candidate operator functions of the form

T& operator*(T*);For every type

Tthere exist candidate operator functions of the form

T* operator+(T*);For every cv-unqualified floating-point or promoted integral type

T, there exist candidate operator functions of the form

Toperator+(T);

Tl operator-(T);

*[Drafting note: Clause 21 [meta] regarding
type traits appropriately handles cv-qualified and
cv-unqualified types and does not require revision.]*