diff options
author | Ivan Fefer <ivan.fefer@mongodb.com> | 2023-02-10 16:49:24 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2023-02-10 21:42:56 +0000 |
commit | eb74202c608550490a603fa31ad8a46f2a92932f (patch) | |
tree | ba89af70b46283513f5374f1352499a9fb3158ec | |
parent | e93a4b101d43b2a5b10446e79995f9ad278c13f7 (diff) | |
download | mongo-eb74202c608550490a603fa31ad8a46f2a92932f.tar.gz |
SERVER-71968 Make MONGO_SOURCE_LOCATION static constexpr in tassert
-rw-r--r-- | src/mongo/util/assert_util.h | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/mongo/util/assert_util.h b/src/mongo/util/assert_util.h index f864738b700..a18ce99569f 100644 --- a/src/mongo/util/assert_util.h +++ b/src/mongo/util/assert_util.h @@ -499,13 +499,14 @@ inline void massertStatusOKWithLocation(const Status& status, const char* file, } } -#define MONGO_BASE_ASSERT_VA_FAILED(fail_func, ...) \ - do { \ - auto mongoSourceLocation = MONGO_SOURCE_LOCATION(); \ - [&]() MONGO_COMPILER_COLD_FUNCTION { \ - fail_func(::mongo::error_details::makeStatus(__VA_ARGS__), mongoSourceLocation); \ - }(); \ - MONGO_COMPILER_UNREACHABLE; \ +#define MONGO_BASE_ASSERT_VA_FAILED(fail_func, ...) \ + do { \ + static constexpr auto _failedAssertionSourceLocation = MONGO_SOURCE_LOCATION(); \ + [&]() MONGO_COMPILER_COLD_FUNCTION { \ + fail_func(::mongo::error_details::makeStatus(__VA_ARGS__), \ + _failedAssertionSourceLocation); \ + }(); \ + MONGO_COMPILER_UNREACHABLE; \ } while (false) #define MONGO_BASE_ASSERT_VA_4(fail_func, code, msg, cond) \ |