]> PatchyGit - patchyircd.git/commitdiff
admin: compat for clang 16
authorEgor <egor@patchysicp.xyz>
Wed, 25 Feb 2026 02:25:48 +0000 (04:25 +0200)
committerEgor <egor@patchysicp.xyz>
Wed, 25 Feb 2026 02:25:48 +0000 (04:25 +0200)
missing p2593r1/cwg2518 support

src/admin.cpp

index 05419ea..f35caee 100644 (file)
@@ -51,10 +51,10 @@ struct SetRef {
                        return "Set<std::string>";
                } else if constexpr (std::same_as<T, Client*>) {
                        return "Set<Client*>";
-               } else if constexpr (std::same_as<T, Channel*>) {
-                       return "Set<Channel*>";
                } else {
-                       static_assert(false);
+                       // TODO: revert this once clang 17+ is more widespread
+                       static_assert(std::same_as<T, Channel*>);
+                       return "Set<Channel*>";
                }
        };
        static constexpr const char *mtname = get_mtname();
@@ -78,10 +78,9 @@ struct SetRef {
                        s.insert(key);
                } else if constexpr (std::same_as<T, Client*>) {
                        s.insert(*(Client **)luaL_checkudata(L, 3, "Client"));
-               } else if constexpr (std::same_as<T, Channel*>) {
-                       s.insert(*(Channel **)luaL_checkudata(L, 3, "Channel"));
                } else {
-                       static_assert(false);
+                       static_assert(std::same_as<T, Channel*>);
+                       s.insert(*(Channel **)luaL_checkudata(L, 3, "Channel"));
                }
                return 0;
        }
@@ -91,10 +90,9 @@ struct SetRef {
                                return "Set<std::string>::Iter";
                        } else if constexpr (std::same_as<T, Client*>) {
                                return "Set<Client*>::Iter";
-                       } else if constexpr (std::same_as<T, Channel*>) {
-                               return "Set<Channel*>::Iter";
                        } else {
-                               static_assert(false);
+                               static_assert(std::same_as<T, Channel*>);
+                               return "Set<Channel*>::Iter";
                        }
                };
                static constexpr const char *mtname = get_mtname();