This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of New status.

3634. When are static-duration memory_resource objects destroyed?

Section: 20.4.4 [mem.res.global], 19.5.3.5 [syserr.errcat.objects] Status: New Submitter: Jiang An Opened: 2021-11-07 Last modified: 2022-01-29

Priority: 3

View all other issues in [mem.res.global].

View all issues with New status.

Discussion:

Both std::pmr::new_delete_resource and std::pmr::null_memory_resource return pointers to static-duration objects. It seems unspecified when the pointed-to objects are destroyed, so users can't reliably use these objects during destructions of their static-duration objects.

std::generic_category and std::system_category have the same issue, except that the referred-to objects may have different storage duration.

Should we specify in which case can these objects be used in the termination of a program?

[2022-01-29; Reflector poll]

Set priority to 3 after reflector poll.

Proposed resolution: