[SERVER-54875] Remove client friendship to make_intrusive Created: 02/Mar/21  Updated: 29/Oct/23  Resolved: 03/Mar/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 4.9.0

Type: Bug Priority: Major - P3
Reporter: Billy Donahue Assignee: Billy Donahue
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Service Arch 2021-03-08
Participants:

 Description   


Friendships to declarations in foreign components are fragile, like any other duplicate declaration. It constrains the upstream library. Usually this is done to keep constructors private but still use make_* functions. Seek workarounds.



 Comments   
Comment by Githook User [ 03/Mar/21 ]

Author:

{'name': 'Billy Donahue', 'email': 'billy.donahue@mongodb.com', 'username': 'BillyDonahue'}

Message: SERVER-54875 remove redeclaration of make_intrusive a client's friend
Branch: master
https://github.com/mongodb/mongo/commit/2861876b008b3089bc9d3cc635c3b9eb80cad2e8

Comment by Billy Donahue [ 02/Mar/21 ]

There aren't many of these.

src/mongo/db/pipeline/document_source_match.h:46:    friend boost::intrusive_ptr<T> make_intrusive(Args&&...);

This is the only one that is declaring a long-distance friendship with a function decl.

Generated at Thu Feb 08 05:34:45 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.