From 178e5ac2fb9f6860e6911cf2e836a0cd63063b16 Mon Sep 17 00:00:00 2001 From: Egor Date: Wed, 25 Feb 2026 04:25:48 +0200 Subject: [PATCH] admin: compat for clang 16 missing p2593r1/cwg2518 support --- src/admin.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/admin.cpp b/src/admin.cpp index 05419ea..f35caee 100644 --- a/src/admin.cpp +++ b/src/admin.cpp @@ -51,10 +51,10 @@ struct SetRef { return "Set"; } else if constexpr (std::same_as) { return "Set"; - } else if constexpr (std::same_as) { - return "Set"; } else { - static_assert(false); + // TODO: revert this once clang 17+ is more widespread + static_assert(std::same_as); + return "Set"; } }; static constexpr const char *mtname = get_mtname(); @@ -78,10 +78,9 @@ struct SetRef { s.insert(key); } else if constexpr (std::same_as) { s.insert(*(Client **)luaL_checkudata(L, 3, "Client")); - } else if constexpr (std::same_as) { - s.insert(*(Channel **)luaL_checkudata(L, 3, "Channel")); } else { - static_assert(false); + static_assert(std::same_as); + s.insert(*(Channel **)luaL_checkudata(L, 3, "Channel")); } return 0; } @@ -91,10 +90,9 @@ struct SetRef { return "Set::Iter"; } else if constexpr (std::same_as) { return "Set::Iter"; - } else if constexpr (std::same_as) { - return "Set::Iter"; } else { - static_assert(false); + static_assert(std::same_as); + return "Set::Iter"; } }; static constexpr const char *mtname = get_mtname(); -- 2.56.0