BranchWatchTableModel: Assume Unreachable Code Truly Is

This commit is contained in:
mitaclaw
2024-05-24 17:47:25 -07:00
parent 7dc0bdd5df
commit 8050760fe9
4 changed files with 30 additions and 3 deletions

View File

@ -0,0 +1,21 @@
// Copyright 2024 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include "Common/CommonFuncs.h"
namespace Common
{
// TODO C++23: Replace with std::unreachable.
[[noreturn]] inline void Unreachable()
{
#ifdef _DEBUG
Crash();
#elif defined(_MSC_VER) && !defined(__clang__)
__assume(false);
#else
__builtin_unreachable();
#endif
}
} // namespace Common