diff --git a/include/fmt/core.h b/include/fmt/core.h index 9f030e38..2e1ae4b6 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -910,7 +910,8 @@ template struct named_arg_info { template struct arg_data { // args_[0].named_args points to named_args_ to avoid bloating format_args. - T args_[1 + (NUM_ARGS != 0 ? NUM_ARGS : 1)]; + // +1 to workaround a bug in gcc 7.5 that causes duplicated-branches warning. + T args_[1 + (NUM_ARGS != 0 ? NUM_ARGS : +1)]; named_arg_info named_args_[NUM_NAMED_ARGS]; template @@ -922,7 +923,8 @@ struct arg_data { template struct arg_data { - T args_[NUM_ARGS != 0 ? NUM_ARGS : 1]; + // +1 to workaround a bug in gcc 7.5 that causes duplicated-branches warning. + T args_[NUM_ARGS != 0 ? NUM_ARGS : +1]; template FMT_INLINE arg_data(const U&... init) : args_{init...} {}