diff options
author | Lioncash <mathew1800@gmail.com> | 2021-04-07 01:23:06 -0400 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2021-04-07 01:23:08 -0400 |
commit | bc30aa82499baea00a4d985f922e489041660ee7 (patch) | |
tree | 46d123dea11c83cb88f30a4cfbf472d1489cf0aa | |
parent | 97e2604575459da8787a20d511d3438ac95d9f1a (diff) |
k_scoped_lock: Mark class as [[nodiscard]]
Prevents logic bugs of the kind described in the previous commit from
slipping through.
-rw-r--r-- | src/core/hle/kernel/k_scoped_lock.h | 2 |
1 files changed, 1 insertions, 1 deletions
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<T> && requires(T & t) { }; template <typename T> -requires KLockable<T> class KScopedLock { +requires KLockable<T> class [[nodiscard]] KScopedLock { public: explicit KScopedLock(T* l) : lock_ptr(l) { this->lock_ptr->Lock(); |