From 92b56cbda0fdab6a3ff31a043c067145a8bcc723 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 29 Feb 2016 20:15:23 +0000 Subject: [PATCH] Avoid a gcc warning in enum option_to_string impl --- src/enum.hh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/enum.hh b/src/enum.hh index 77979e59..728a56d2 100644 --- a/src/enum.hh +++ b/src/enum.hh @@ -43,8 +43,10 @@ EnableIfWithoutBitOps option_to_string(Enum e) { constexpr auto desc = enum_desc(Enum{}); auto it = find_if(desc, [e](const EnumDesc& d) { return d.value == e; }); - kak_assert(it != desc.end()); - return it->name.str(); + if (it != desc.end()) + return it->name.str(); + kak_assert(false); + return {}; } template