From: Egor Date: Wed, 25 Feb 2026 02:25:48 +0000 (+0200) Subject: admin: compat for clang 16 X-Git-Url: https://git.patchysicp.xyz/?a=commitdiff_plain;h=178e5ac2fb9f6860e6911cf2e836a0cd63063b16;p=patchyircd.git admin: compat for clang 16 missing p2593r1/cwg2518 support --- 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();