Created on 2006-04-13.00:00:00 last changed 130 months ago
[Voted into the WP at the March, 2011 meeting.]
Proposed resolution (November, 2010):
Change _N4885_6.7.5.5.4 [basic.stc.dynamic.safety] paragraphs 1-2 as follows:
A traceable pointer object is
an object of
pointer-to-objectan object pointer type (6.8.4 [basic.compound]), oran object of an integral type that is at least as large as std::intptr_t, or
a sequence of elements in an array of character type, where the size and alignment of the sequence match
thatthose of somepointer-to-objectobject pointer type.A pointer value is a safely-derived pointer to a dynamic object only if it has
pointer-to-objectan object pointer type and it is...
Change 6.8.4 [basic.compound] paragraphs 3-4 as follows:
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] The type of a pointer that can designate a function is called a function pointer type. A pointer to objects of type T is referred to as a “pointer to T.” [Example:...
Objects of cv-qualified (6.8.5 [basic.type.qualifier]) or cv-unqualified type void* (pointer to void),A pointer to cv-qualified (6.8.5 [basic.type.qualifier]) or cv-unqualified void can be used to point to objects of unknown type.A void*Such a pointer shall be able to hold any object pointer.A cv-qualified or cv-unqualified (6.8.5 [basic.type.qualifier])An object of type cv void* shall have the same representation and alignment requirements asa cv-qualified or cv-unqualifiedcv char*.
Change 7.3.12 [conv.ptr] paragraph 1 as follows:
...A null pointer constant can be converted to a pointer type; the result is the null pointer value of that type and is distinguishable from every other value ofpointer to object or pointer to functionobject pointer or function pointer type...
Change 7.3.13 [conv.mem] paragraph 2 footnote 58 as follows:
...Note that a pointer to member is nota pointer to object or a pointer to functionan object pointer or a function pointer and...
Change 7.6.1.10 [expr.reinterpret.cast] paragraphs 6-8 as follows:
A
pointer to afunction pointer can be explicitly converted to apointer to afunction pointer of a different type...
A pointer to anAn object pointer can be explicitly converted toa pointer to a different object typean object pointer of a different type...Converting a
pointer to a function into a pointer to an objectfunction pointer to an object pointer type or vice versa is conditionally-supported...
Change the note in 9.3.4.6 [dcl.fct] paragraph 6 as follows:
[Note: function types are checked during the assignments and initializations ofpointer-to-functions, reference-to-functions, and pointer-to-member-functionspointers to functions, references to functions, and pointers to member functions. —end note]
In the “Index of Implementation-defined Behavior,” change the following item as indicated:
convertingpointer to function into pointer to objectfunction pointer to object pointer and vice versa
[Drafting note: 7.6.2.9 [expr.delete] paragraph 1 was not changed, so the operand of delete still cannot be a void*. 12.5 [over.built] paragraph 14 was not changed, so void* pointers still do not get overloads for operator-. 13.2 [temp.param] paragraph 4 was not changed and thus continues to allow only pointers to objects, not object pointers, as non-type template parameters.]
(See also issue 1120.)
The resolution to issue 195 makes “converting a pointer to a function into a pointer to an object type or vice versa” conditionally-supported behavior. In doing so, however, it overlooked the fact that void is not an “object type” (6.8 [basic.types] paragraph 9). The wording should be amended to allow conversion to and from void* types.
History | |||
---|---|---|---|
Date | User | Action | Args |
2014-03-03 00:00:00 | admin | set | status: fdis -> c++11 |
2011-04-10 00:00:00 | admin | set | status: ready -> fdis |
2010-11-29 00:00:00 | admin | set | status: drafting -> ready |
2010-03-29 00:00:00 | admin | set | status: review -> drafting |
2010-02-16 00:00:00 | admin | set | messages: + msg2529 |
2010-02-16 00:00:00 | admin | set | status: drafting -> review |
2008-10-05 00:00:00 | admin | set | status: review -> drafting |
2008-06-29 00:00:00 | admin | set | messages: + msg1694 |
2008-06-29 00:00:00 | admin | set | status: drafting -> review |
2006-11-05 00:00:00 | admin | set | status: open -> drafting |
2006-04-13 00:00:00 | admin | create |