summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCelina Tala <celinahtala@gmail.com>2022-09-21 20:49:07 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-09-21 23:28:33 +0000
commit57ec58be983a84cc5465b3ae1a5411446677c65c (patch)
tree04fa4c7b753e649f0b5a4f6d259cd57c82b8c438
parentf63252fbd6cbb7ef0ac1375542a636bb017dec72 (diff)
downloadmongo-57ec58be983a84cc5465b3ae1a5411446677c65c.tar.gz
SERVER-42810 Changed `throw()` to `noexcept`
-rw-r--r--src/mongo/client/cyrus_sasl_client_session.cpp6
-rw-r--r--src/mongo/client/sasl_sspi.cpp4
-rw-r--r--src/mongo/db/repl/rs_rollback.h2
-rw-r--r--src/mongo/util/assert_util.h2
4 files changed, 7 insertions, 7 deletions
diff --git a/src/mongo/client/cyrus_sasl_client_session.cpp b/src/mongo/client/cyrus_sasl_client_session.cpp
index c92c4927d26..b1a5fbf75cd 100644
--- a/src/mongo/client/cyrus_sasl_client_session.cpp
+++ b/src/mongo/client/cyrus_sasl_client_session.cpp
@@ -116,7 +116,7 @@ MONGO_INITIALIZER(CyrusSaslAllocatorsAndMutexes)(InitializerContext*) {
sasl_set_mutex(saslMutexAlloc, saslMutexLock, saslMutexUnlock, saslMutexFree);
}
-int saslClientLogSwallow(void* context, int priority, const char* message) throw() {
+int saslClientLogSwallow(void* context, int priority, const char* message) noexcept {
return SASL_OK; // do nothing
}
@@ -159,7 +159,7 @@ MONGO_INITIALIZER_WITH_PREREQUISITES(CyrusSaslClientContext,
* Note that in Mongo, the authentication and authorization ids (authid and authzid) are always
* the same. These correspond to SASL_CB_AUTHNAME and SASL_CB_USER.
*/
-int saslClientGetSimple(void* context, int id, const char** result, unsigned* resultLen) throw() {
+int saslClientGetSimple(void* context, int id, const char** result, unsigned* resultLen) noexcept {
try {
CyrusSaslClientSession* session = static_cast<CyrusSaslClientSession*>(context);
if (!session || !result)
@@ -194,7 +194,7 @@ int saslClientGetSimple(void* context, int id, const char** result, unsigned* re
int saslClientGetPassword(sasl_conn_t* conn,
void* context,
int id,
- sasl_secret_t** outSecret) throw() {
+ sasl_secret_t** outSecret) noexcept {
try {
CyrusSaslClientSession* session = static_cast<CyrusSaslClientSession*>(context);
if (!session || !outSecret)
diff --git a/src/mongo/client/sasl_sspi.cpp b/src/mongo/client/sasl_sspi.cpp
index 9500606dacd..5c085da5449 100644
--- a/src/mongo/client/sasl_sspi.cpp
+++ b/src/mongo/client/sasl_sspi.cpp
@@ -106,7 +106,7 @@ void HandleLastError(const sasl_utils_t* utils, DWORD errCode, const char* msg)
int sspiClientMechNew(void* glob_context,
sasl_client_params_t* cparams,
- void** conn_context) throw() {
+ void** conn_context) noexcept {
// Prepare auth identity to pass to AcquireCredentialsHandle
SEC_WINNT_AUTH_IDENTITY authIdentity;
authIdentity.Flags = SEC_WINNT_AUTH_IDENTITY_UNICODE;
@@ -356,7 +356,7 @@ int sspiClientMechStep(void* conn_context,
sasl_interact_t** prompt_need,
const char** clientout,
unsigned* clientoutlen,
- sasl_out_params_t* oparams) throw() {
+ sasl_out_params_t* oparams) noexcept {
SspiConnContext* pcctx = static_cast<SspiConnContext*>(conn_context);
*clientout = nullptr;
*clientoutlen = 0;
diff --git a/src/mongo/db/repl/rs_rollback.h b/src/mongo/db/repl/rs_rollback.h
index 2f4e8a60139..da0ac3bc858 100644
--- a/src/mongo/db/repl/rs_rollback.h
+++ b/src/mongo/db/repl/rs_rollback.h
@@ -357,7 +357,7 @@ struct FixUpInfo {
class RSFatalException : public std::exception {
public:
RSFatalException(std::string m = "replica set fatal exception") : msg(m) {}
- virtual const char* what() const throw() {
+ const char* what() const noexcept override {
return msg.c_str();
}
diff --git a/src/mongo/util/assert_util.h b/src/mongo/util/assert_util.h
index 2a315e885c4..4b664f72d0b 100644
--- a/src/mongo/util/assert_util.h
+++ b/src/mongo/util/assert_util.h
@@ -66,7 +66,7 @@ std::string causedBy(const std::string& e);
/** Most mongo exceptions inherit from this; this is commonly caught in most threads */
class DBException : public std::exception {
public:
- const char* what() const throw() final {
+ const char* what() const noexcept final {
return reason().c_str();
}