Movatterモバイル変換


[0]ホーム

URL:


Issue 342 - WG21 CWG Issues
Title
Terminology: "indirection" versus "dereference"
Status
cd3
Section
7.6.2 [expr.unary]
Submitter
Jason Merrill

Created on2001-10-07.00:00:00 last changed145 months ago

Messages

msg4132 (view)
Date: 2012-10-15.00:00:00

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

msg3701 (view)
Date: 2012-02-15.00:00:00

Proposed resolution (February, 2012):

  1. Change 6.8.6.5.2 [basic.stc.dynamic.allocation] paragraph 2 as follows:

  2. ...The effect ofdereferencingindirectingthrough a pointer returned as a request for zero size isundefined.
  3. Change _N4885_6.7.5.5.4 [basic.stc.dynamic.safety] paragraph 2 as follows:

    • the value returned by a call to the C ++ standard libraryimplementation of::operator new(std:: size_t);[Footnote: This section does not impose restrictions ondereferencingindirection through pointers tomemory not allocated by::operator new. This maintains theability of many C++ implementations to use binary libraries andcomponents written in other languages. In particular, this applies toC binaries, becausedereferencingindirectionthrough pointers to memory allocated bystd::malloc is not restricted. —endfootnote]

    • the result of taking the address of an object (or one of itssubobjects) designated by an lvalue resulting fromdereferencingindirection through asafely-derived pointer value;

    • ...

  4. Change 6.8.4 [basic.life] paragraph 5 as follows:

  5. ...SuchIndirection through such a pointermay be dereferencedis permitted but theresulting lvalue may only be used in limited ways...
  6. Change 7.3.13 [conv.mem] paragraph 2 as follows:

  7. ...Since the result has type “pointer to member ofD oftypecvT”,it can be dereferencedindirection through it with aD objectisvalid. The result is the same as ifindirectingthrough the pointer to member ofBweredereferenced with theB subobject ofD. Thenull member pointer value...
  8. Change 7.6.1.9 [expr.static.cast] paragraph 12 as follows:

  9. ...[Note: although classB need not contain theoriginal member, the dynamic type of the objectonwith whichindirection through the pointer tomember isdereferencedperformed must containthe original member; see 7.6.4 [expr.mptr.oper]. —endnote]
  10. Change 7.6.2.2 [expr.unary.op] paragraph 1 as follows:

  11. ...[Note:indirection through a pointer to anincomplete type (other thancvvoid)can bedereferencedis valid. The lvalue thus obtained...
  12. Change 7.6.10 [expr.eq] paragraph 2 as follows:

  13. ...Otherwise they compare equal if and only if they would refer to thesame member of the same most derived object (6.8.2 [intro.object])or the same subobject ifthey were dereferencedindirection with a hypothetical object of the associatedclass typewere performed. [Example:...
  14. Change 9.12 [dcl.link] paragraph 8:

  15. [Note: Because the language linkage is part of a function type,whenindirecting through a pointer to C function(forexample) is dereferenced, the function to whichitthe resulting lvalue refers is considered a Cfunction. —end note]
  16. Change 9.3.4.3 [dcl.ref] paragraph 5 as follows:

  17. ...[Note: in particular, a null reference cannot exist in awell-defined program, because the only way to create such a referencewould be to bind it to the “object” obtained bydereferencingindirection through a nullpointer, which causes undefined behavior. As described...
  18. Change 16.4.4.6 [allocator.requirements] table 27:

  19. VariableDefinition
    ...
    cadereferenceable pointer of typeC*through which indirection is valid
    ...
  20. Change 20.2.3.3 [pointer.traits.functions] as follows:

  21. Returns: The first member function returns adereferenceable pointer tor obtained by callingPtr::pointer_to(r)through which indirection isvalid; an instantiation of this function is ill-formed...
  22. Change _N4885_.20.10.5 [util.dynamic.safety] paragraph 10 as follows:

  23. Effects: Then bytes starting atp no longercontain traceable pointer locations, independent of their type. Hencepointersindirection through a pointer locatedtheremay not be dereferencedis undefined ifthe objectthey pointit points to was createdby globaloperator new and not previously declaredreachable...
  24. Change 26.11 [specialized.algorithms] paragraph 1 as follows:

  25. ...is required to have the property that no exceptions are thrown fromincrement, assignment, comparison, ordereference ofindirection through valid iterators...
  26. Change 28.3.4.6.2.3 [locale.time.get.virtuals] paragraph 11 as follows:

  27. Requires:t shallbe dereferenceablepoint to an object.
  28. Change 23.4.3.2 [map.cons] paragraph 3 as follows:

  29. Requires: If the iterator'sdereferenceindirection operator returns an lvalue or a const rvaluepair<key_type, mapped_type>, then bothkey_type andmapped_type shall beCopyConstructible.
  30. Change 23.4.4.2 [multimap.cons] paragraph 3 as follows:

  31. Requires: If the iterator'sdereferenceindirection operator returns an lvalue or a const rvaluepair<key_type, mapped_type>, then bothkey_type andmapped_type shall beCopyConstructible.
  32. Change 23.4.6.2 [set.cons] paragraph 4 as follows:

  33. Requires: If the iterator'sdereferenceindirection operator returns an lvalue or a non-constrvalue, thenKey shall beCopyConstructible.
  34. Change 23.4.7.2 [multiset.cons] paragraph 3 as follows:

  35. Requires: If the iterator'sdereferenceindirection operator returns an lvalue or a const rvalue,thenKey shall beCopyConstructible.
  36. Change 24.5.4 [move.iterators] paragraph 1 as follows:

  37. Class templatemove_iterator is an iterator adaptor with thesame behavior as the underlying iterator except that itsdereferenceindirection operator implicitlyconverts the value returned by the underlying iterator'sdereferenceindirection operator to an rvaluereference...
  38. Change the title of 28.6.11.1.4 [re.regiter.deref] as follows:

  39. regex_iteratordereferenceindirection
  40. Change the title of 28.6.11.2.4 [re.tokiter.deref] as follows:

  41. regex_token_iteratordereferenceindirection
msg3521 (view)
Date: 2011-08-15.00:00:00

Notes from the August, 2011 meeting:

CWG prefers use of the term “indirection” instead of“dereferencing.” This would be consistent with the usagein the C Standard and would avoid entanglement with the C++ conceptof a reference type.

msg1403 (view)
Date: 2006-12-15.00:00:00

Proposed resolution (December, 2006):

  1. Change 7.6.2.2 [expr.unary.op] paragraph 1 as follows:

  2. The unary*operatorperformsindirectiondereferences a pointervalue: the expression to which it is applied shall be a pointer...
  3. Change 9.3.4.5 [dcl.array] paragraph 8 as follows:

  4. Theresults are added and indirection appliedvalues areadded and the result is dereferenced to yield an array (of fiveintegers), which in turn is converted to a pointer to the first of theintegers.
  5. Change 9.3.4.6 [dcl.fct] paragraph 9 as follows:

  6. The binding of*fpi(int) is*(fpi(int)), so thedeclaration suggests, and the same construction in an expressionrequires, the calling of a functionfpi, and thenusingindirection throughdereferencing the (pointer) resultto yield an integer. In the declarator(*pif)(const char*, constchar*), the extra parentheses are necessary to indicate thatindirection throughdereferencing a pointer to afunction yields a function, which is then called.
  7. Change the index for* and “dereferencing”no longer to refer to “indirection.”

[Drafting note: 29.6.9 [template.indirect.array]requires no change. Many more places in the current wording use“dereferencing” than “indirection.”]

msg649 (view)
Date: 2004-09-10.00:00:00

Split off fromissue 315.

Incidentally, another thing that ought to be cleaned up is the inconsistentuse of "indirection" and "dereference". We should pick one.

History
DateUserActionArgs
2014-03-03 00:00:00adminsetstatus: drwp -> cd3
2013-05-03 00:00:00adminsetstatus: dr -> drwp
2012-11-03 00:00:00adminsetmessages: +msg4132
2012-11-03 00:00:00adminsetstatus: ready -> dr
2012-02-27 00:00:00adminsetmessages: +msg3701
2012-02-27 00:00:00adminsetstatus: drafting -> ready
2011-09-06 00:00:00adminsetmessages: +msg3521
2011-09-06 00:00:00adminsetstatus: review -> drafting
2006-11-05 00:00:00adminsetmessages: +msg1403
2006-11-05 00:00:00adminsetstatus: open -> review
2001-10-07 00:00:00admincreate

[8]ページ先頭

©2009-2026 Movatter.jp