[SERVER-34307] replace invariant(false) with MONGO_UNREACHABLE Created: 04/Apr/18  Updated: 29/Oct/23  Resolved: 05/Apr/18

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

Type: Improvement Priority: Trivial - P5
Reporter: Benety Goh Assignee: Benety Goh
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-34396 Fail to compile if io manipulators li... Closed
Backwards Compatibility: Fully Compatible
Sprint: Repl 2018-04-09
Participants:

 Description   

We use invariant(false) a lot in the codebase when we really mean MONGO_UNREACHABLE. Using the MONGO_UNREACHABLE macro also sends a signal to the compiler that execution will not proceed past that location in the code (See SERVER-29780 for example).



 Comments   
Comment by Githook User [ 18/Apr/18 ]

Author:

{'email': 'mathias@10gen.com', 'name': 'Mathias Stearn', 'username': 'RedBeard0531'}

Message: SERVER-34396 Fail to compile if io manipulators like std::hex are passed to StringBuilder/str::stream

This includes a partial revert of 80f409d1311eb8d20251d17be474aff382538b84
(SERVER-34307) to address this bug.
Branch: master
https://github.com/mongodb/mongo/commit/d976399cc97e4973cbd48191aa5730e8f01547a8

Comment by Githook User [ 05/Apr/18 ]

Author:

{'email': 'benety@mongodb.com', 'name': 'Benety Goh', 'username': 'benety'}

Message: SERVER-34307 replace invariant(false) with MONGO_UNREACHABLE
Branch: master
https://github.com/mongodb/mongo/commit/80f409d1311eb8d20251d17be474aff382538b84

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