From 01dab0b953b945a46492efc6eccb54bab07287b6 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 1 Apr 2022 11:17:20 +0200 Subject: QGlobalStatic: mark functions that inspect the guard noexcept Because they are. Pick-to: 6.3 Change-Id: I60e94ebbe6fcd624195aeaed5de76cabc61c3178 Reviewed-by: Giuseppe D'Angelo --- src/corelib/global/qglobalstatic.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/corelib/global/qglobalstatic.h b/src/corelib/global/qglobalstatic.h index beecc1f000..f758baf15d 100644 --- a/src/corelib/global/qglobalstatic.h +++ b/src/corelib/global/qglobalstatic.h @@ -94,8 +94,8 @@ template struct QGlobalStatic { using Type = typename Holder::Type; - bool isDestroyed() const { return guardValue() <= QtGlobalStatic::Destroyed; } - bool exists() const { return guardValue() == QtGlobalStatic::Initialized; } + bool isDestroyed() const noexcept { return guardValue() <= QtGlobalStatic::Destroyed; } + bool exists() const noexcept { return guardValue() == QtGlobalStatic::Initialized; } operator Type *() { if (isDestroyed()) @@ -127,7 +127,7 @@ protected: static Holder holder; return holder.pointer(); } - static QtGlobalStatic::GuardValues guardValue() + static QtGlobalStatic::GuardValues guardValue() noexcept { return QtGlobalStatic::GuardValues(Holder::guard.loadAcquire()); } -- cgit v1.2.3