Skip to content

Commit

Permalink
Fix unannoted fallthrough
Browse files Browse the repository at this point in the history
Fixes #402.
  • Loading branch information
jarro2783 committed Jun 14, 2023
1 parent a526762 commit 90b3181
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions include/cxxopts.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@ THE SOFTWARE.
# endif
#endif

#define CXXOPTS_FALLTHROUGH
#ifdef __has_cpp_attribute
#if __has_cpp_attribute(fallthrough)
#undef CXXOPTS_FALLTHROUGH
#define CXXOPTS_FALLTHROUGH [[fallthrough]]
#endif
#endif

#if __cplusplus >= 201603L
#define CXXOPTS_NODISCARD [[nodiscard]]
#else
Expand Down Expand Up @@ -2239,6 +2247,7 @@ OptionAdder::operator()
case 1:
short_name = *first_short_name_iter;
option_names.erase(first_short_name_iter);
CXXOPTS_FALLTHROUGH;
case 0:
break;
default:
Expand Down

0 comments on commit 90b3181

Please sign in to comment.