From 9abef6f25aadfd04309cb2219068097f93dc961d Mon Sep 17 00:00:00 2001 From: ADAM David Alan Martin Date: Sun, 18 Jun 2017 23:22:02 -0400 Subject: SERVER-27244 Status usage compile-time facilities. There are numerous places in the codebase where `mongo::Status` or `mongo::StatusWith< T >` objects are returned and never checked. Many of these are innocuous, but many of them are potentially severe bugs. This change introduces facilities to permit compile-time warning of unchecked `Status` and `StatusWith` usage on clang compilers. It introduces an `ignore` function which is useful to state that a specific "ignored status" case was intentional. It not presently an error, in clang builds, to forget to check a `Status` -- this will come in a later commit. This also introduces a `transitional_ignore` function, which allows for easy continual auditing of the codebase for current "whitelisted" unchecked-status instances. All present "ignored status" cases have been marked `transitional_ignore`. --- src/mongo/db/repl/databases_cloner_test.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/mongo/db/repl/databases_cloner_test.cpp') diff --git a/src/mongo/db/repl/databases_cloner_test.cpp b/src/mongo/db/repl/databases_cloner_test.cpp index 36020cea9a8..5e7ceacae2b 100644 --- a/src/mongo/db/repl/databases_cloner_test.cpp +++ b/src/mongo/db/repl/databases_cloner_test.cpp @@ -176,7 +176,8 @@ protected: log() << "reusing collection during test which may cause problems, ns:" << nss; } (collInfo->loader = new CollectionBulkLoaderMock(&collInfo->stats)) - ->init(secondaryIndexSpecs); + ->init(secondaryIndexSpecs) + .transitional_ignore(); return StatusWith>( std::unique_ptr(collInfo->loader)); -- cgit v1.2.1