SERVER-105887Open

Annotate BSONElement and BSONObj APIs with [[clang::lifetimebound]]

{{BSONElement}} instances are always views into a subset of a buffer containing a BSON document which is owned by a different object, and {{BSONObj}} instances are sometimes views of the entire documents to which they refer. We currently lack any compile-time protections against temporal memory misuses of these types due to referencing underlying buffers after their owning objects have been destroyed. Investigate solving these temporal memory misuses by annotating the {{BSONElement}} and {{BSONO

Affected Versions
Versions known to exhibit this issue

No affected versions recorded.

Fixed Versions
Versions that include the fix

No fix available yet.

Components
Server components related to this issue

No components specified.

Labels
Tags and classification
sp-bson