Skip to content

Commit ba21005

Browse files
committed
Fix switch fallthrough warning in generator.hpp
Add [[fallthrough]] attribute after std::rethrow_exception to silence compiler warning about missing return/break.
1 parent 9f09e91 commit ba21005

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cpp/include/mh/coroutine/generator.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ namespace mh
5353
// Nothing to do
5454
}
5555

56-
const_reference& value() const
56+
[[nodiscard]] const_reference& value() const
5757
{
5858
switch (m_State.index())
5959
{
@@ -63,6 +63,7 @@ namespace mh
6363
return *std::get<1>(m_State);
6464
case 2:
6565
std::rethrow_exception(std::get<2>(m_State));
66+
[[fallthrough]];
6667
default:
6768
throw std::logic_error("invalid promise state");
6869
}

0 commit comments

Comments
 (0)