mirror of
https://github.com/fmtlib/fmt.git
synced 2025-08-01 19:54:46 +02:00
Fix more bogus MSVC warnings about unreachable code (#748)
This commit is contained in:
@@ -740,8 +740,8 @@ class basic_parse_context : private ErrorHandler {
|
|||||||
|
|
||||||
FMT_CONSTEXPR bool check_arg_id(unsigned) {
|
FMT_CONSTEXPR bool check_arg_id(unsigned) {
|
||||||
if (next_arg_id_ > 0) {
|
if (next_arg_id_ > 0) {
|
||||||
on_error("cannot switch from automatic to manual argument indexing");
|
return on_error(
|
||||||
return false;
|
"cannot switch from automatic to manual argument indexing"), false;
|
||||||
}
|
}
|
||||||
next_arg_id_ = -1;
|
next_arg_id_ = -1;
|
||||||
return true;
|
return true;
|
||||||
|
@@ -1322,8 +1322,7 @@ template <typename Char, typename ErrorHandler>
|
|||||||
FMT_CONSTEXPR unsigned basic_parse_context<Char, ErrorHandler>::next_arg_id() {
|
FMT_CONSTEXPR unsigned basic_parse_context<Char, ErrorHandler>::next_arg_id() {
|
||||||
if (next_arg_id_ >= 0)
|
if (next_arg_id_ >= 0)
|
||||||
return internal::to_unsigned(next_arg_id_++);
|
return internal::to_unsigned(next_arg_id_++);
|
||||||
on_error("cannot switch from manual to automatic argument indexing");
|
return on_error("cannot switch from manual to automatic argument indexing"), 0;
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct format_string {};
|
struct format_string {};
|
||||||
@@ -1703,8 +1702,7 @@ class width_checker: public function<unsigned long long> {
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
FMT_CONSTEXPR typename std::enable_if<
|
FMT_CONSTEXPR typename std::enable_if<
|
||||||
!is_integer<T>::value, unsigned long long>::type operator()(T) {
|
!is_integer<T>::value, unsigned long long>::type operator()(T) {
|
||||||
handler_.on_error("width is not integer");
|
return handler_.on_error("width is not integer"), 0;
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -2058,10 +2056,8 @@ FMT_CONSTEXPR Iterator parse_format_specs(Iterator it, SpecHandler &&handler) {
|
|||||||
}
|
}
|
||||||
if (align != ALIGN_DEFAULT) {
|
if (align != ALIGN_DEFAULT) {
|
||||||
if (p != it) {
|
if (p != it) {
|
||||||
if (c == '{') {
|
if (c == '{')
|
||||||
handler.on_error("invalid fill character '{'");
|
return handler.on_error("invalid fill character '{'"), it;
|
||||||
return it;
|
|
||||||
}
|
|
||||||
it += 2;
|
it += 2;
|
||||||
handler.on_fill(c);
|
handler.on_fill(c);
|
||||||
} else ++it;
|
} else ++it;
|
||||||
|
Reference in New Issue
Block a user