Skip to content

Commit 8fe787f

Browse files
Update checkexceptionsafety.cpp
1 parent 83217b8 commit 8fe787f

1 file changed

Lines changed: 4 additions & 13 deletions

File tree

lib/checkexceptionsafety.cpp

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -297,26 +297,17 @@ void CheckExceptionSafety::nothrowThrows()
297297
continue;
298298

299299
bool isNoExcept = false, isEntryPoint = false;
300-
301-
// check noexcept and noexcept(true) functions
302-
if (function->isNoExcept()) {
303-
isNoExcept = true;
304-
}
305-
306-
// check throw() functions
307-
else if (function->isThrow() && !function->throwArg) {
308-
isNoExcept = true;
309-
}
310-
311-
// check __attribute__((nothrow)) or __declspec(nothrow) functions
312-
else if (function->isAttributeNothrow()) {
300+
if (function->isNoExcept() || // noexcept and noexcept(true) functions
301+
(function->isThrow() && !function->throwArg) || // throw() functions
302+
function->isAttributeNothrow()) { // __attribute__((nothrow)) or __declspec(nothrow) functions
313303
isNoExcept = true;
314304
}
315305
else if (mSettings->library.isentrypoint(function->name())) {
316306
isEntryPoint = true;
317307
}
318308
if (!isNoExcept && !isEntryPoint)
319309
continue;
310+
320311
if (const Token* throws = functionThrows(function)) {
321312
if (isEntryPoint)
322313
entryPointThrowError(throws);

0 commit comments

Comments
 (0)