We have this piece of code in collection_cloner.cpp:
CollectionBulkLoader::ParseRecordIdAndDocFunc fn = (_recordIdsReplicated)
? ([](const BSONObj& doc) {
return std::make_pair(RecordId(doc["r"].Long()), doc["d"].Obj());
})
: ([](const BSONObj& doc) { return std::make_pair(RecordId(0), doc); });
This is problematic as described in SERVER-121669, because the temporary that the function_ref is bound to is destroyed right after that line.
- is related to
-
SERVER-121669 Clang tidy rule to prevent function_ref from being assigned to
-
- Backlog
-