[SERVER-36710] Constructing a StatusWith from a call to Status::OK() should fail to compile Created: 16/Aug/18  Updated: 08/Jan/24

Status: Open
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Mathias Stearn Assignee: Backlog - Service Architecture
Resolution: Unresolved Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Service Arch
Participants:

 Description   

It is always an error to construct a StatusWith from an OK status. In the case of Status::OK() we can detect that at compile time. This can easily happen when converting a function from returning Status to StatusWith.



 Comments   
Comment by Mathias Stearn [ 05/Apr/22 ]

This may be easier in C++20 since we should be able to make Status::OK() constexpr, which will make it work with clang's warn_if attribute.

Comment by Lauren Lewis (Inactive) [ 02/Nov/21 ]

The Service Arch team is in the process of cleaning up tickets in the backlog. This ticket has not been updated in two years so we are closing it. Please reopen if you think this change is valuable.

Comment by Mira Carey [ 06/May/19 ]

this isn't urgent enough for that, kicking to the backlog (we'll get to it when we get to it)

Comment by Gregory McKeon (Inactive) [ 06/May/19 ]

mira.carey@mongodb.com can we mark this 4.2.0 and address it between the rc and GA?

Comment by Gregory McKeon (Inactive) [ 12/Sep/18 ]

sara.williamson bit confused by this one - is this in DwS, or in a future quick wins epic? Is it in progress? I've set it back to open for now, feel free to change.

Generated at Thu Feb 08 04:43:52 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.