diff options
author | Luis Osta <luis.osta@mongodb.com> | 2021-05-24 14:44:00 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-05-24 15:25:42 +0000 |
commit | 73e1b6ded626d76129bf83418d3bad6a114c6424 (patch) | |
tree | 6e7410f287759a474434397c63443881c933f97d /src | |
parent | b173494aa6b84b5d44c5f958fd78dd469596a314 (diff) | |
download | mongo-73e1b6ded626d76129bf83418d3bad6a114c6424.tar.gz |
SERVER-55139 Fix documentation for MONGO_UNREACHABLE
Diffstat (limited to 'src')
-rw-r--r-- | src/mongo/util/assert_util.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/mongo/util/assert_util.h b/src/mongo/util/assert_util.h index 2b64163c6cb..2e5d305857b 100644 --- a/src/mongo/util/assert_util.h +++ b/src/mongo/util/assert_util.h @@ -658,9 +658,8 @@ Status exceptionToStatus() noexcept; } /** - * The purpose of this macro is to instruct the compiler that a line of code will never be reached. - * - * Example: + * Produces an invariant failure if executed. Use when reaching this statement indicates a + * programming error. Example: * // code above checks that expr can only be FOO or BAR * switch (expr) { * case FOO: { ... } @@ -668,7 +667,9 @@ Status exceptionToStatus() noexcept; * default: * MONGO_UNREACHABLE; */ - #define MONGO_UNREACHABLE ::mongo::invariantFailed("Hit a MONGO_UNREACHABLE!", __FILE__, __LINE__); +/** + * Like `MONGO_UNREACHABLE`, but triggers a `tassert` instead of an `invariant` + */ #define MONGO_UNREACHABLE_TASSERT(msgid) tasserted(msgid, "Hit a MONGO_UNREACHABLE_TASSERT!") |