From bc30aa82499baea00a4d985f922e489041660ee7 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 7 Apr 2021 01:23:06 -0400 Subject: k_scoped_lock: Mark class as [[nodiscard]] Prevents logic bugs of the kind described in the previous commit from slipping through. --- src/core/hle/kernel/k_scoped_lock.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/core/hle/kernel/k_scoped_lock.h b/src/core/hle/kernel/k_scoped_lock.h index d7cc557b2..543555680 100644 --- a/src/core/hle/kernel/k_scoped_lock.h +++ b/src/core/hle/kernel/k_scoped_lock.h @@ -20,7 +20,7 @@ concept KLockable = !std::is_reference_v && requires(T & t) { }; template -requires KLockable class KScopedLock { +requires KLockable class [[nodiscard]] KScopedLock { public: explicit KScopedLock(T* l) : lock_ptr(l) { this->lock_ptr->Lock(); -- cgit v1.2.3