[SERVER-75055] Remove use of MONGO_HAVE_STD_IS_TRIVIALLY_COPYABLE Created: 20/Mar/23  Updated: 29/Oct/23  Resolved: 20/Mar/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.0.0-rc0

Type: Bug Priority: Major - P3
Reporter: Spencer Jackson 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 2023-04-03
Participants:

 Description   

The MONGO_HAVE_STD_IS_TRIVIALLY_COPYABLE macro is not defined in our codebase. Unfortunately, we still reference it, and safety checks will change their behavior based on it.

In particular DataRange-like types use a data serializer/deserializer template called DataType::Handler, whose default implementation guards a safety check behind MONGO_HAVE_STD_IS_TRIVIALLY_COPYABLE. This guard prevents the safety check from being evaluated. As a result, code like

  uassertStatusOK(bodyBuilder.writeAndAdvance<std::string>(reply.body));

Will incorrectly compile and run, and will not load reply.body's text into the builder.



 Comments   
Comment by Githook User [ 20/Mar/23 ]

Author:

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

Message: SERVER-75055 assume std::is_trivially_copyable exists
Branch: master
https://github.com/mongodb/mongo/commit/07c5ea19d962f1c53ec88183a4ae14cfe53cdc44

Generated at Thu Feb 08 06:29:12 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.