<memory>
: !_Get_ptr()
in the destructors of inout_ptr_t
and out_ptr_t
_should_ be correct
#4964
Labels
LWG issue needed
A wording defect that should be submitted to LWG as a new issue
Describe the bug
Currently
!_Get_ptr()
is used in the destructors ofinout_ptr_t
andout_ptr_t
.STL/stl/inc/memory
Lines 4409 to 4411 in a26f4ad
STL/stl/inc/memory
Lines 4328 to 4330 in a26f4ad
However, it seems that nothing in Cpp17NullablePointer ([nullablepointer.requirements]) requires
!p
to be semantically equivalent top != nullptr
or even to be well-formed. E.g. a type with a deleted memberoperator!
(theNoExclamation
type shown below) can still meet the Cpp17NullablePointer requirements.Currently no implementation accepts the example due to the deleted
operator!
.Command-line test case
Godbolt link
Expected behavior
Perhaps the program should compile.
STL version
a26f4ad (probably every version after #1998)
Additional context
As libc++ and libstdc++ also expect usable
operator!
, should there be an LWG issue to make current implementation strategies comforming?The text was updated successfully, but these errors were encountered: