Fixes for some pedantic warnings (#1054)

* Fix order of initializers

* Remove unused parameter

* Disable warning "-Wswitch-enum"
This commit is contained in:
Brian 2019-02-23 14:40:08 -05:00 committed by Victor Zverovich
parent 8af651be39
commit 327d4b6e9e
2 changed files with 6 additions and 2 deletions

View File

@ -62,6 +62,10 @@
#if FMT_GCC_VERSION >= 406 || FMT_CLANG_VERSION
# pragma GCC diagnostic push
// Disable warning about not handling all enums in switch statement even with
// a default case
# pragma GCC diagnostic ignored "-Wswitch-enum"
// Disable the warning about declaration shadowing because it affects too
// many valid cases.
# pragma GCC diagnostic ignored "-Wshadow"

View File

@ -209,7 +209,7 @@ namespace std {
// Implementation details:
using format_arg = basic_format_arg<basic_format_context>;
basic_format_context(O out, basic_format_args<basic_format_context> args, fmt::internal::locale_ref)
: out_(out), args_(args) {}
: args_(args), out_(out) {}
fmt::internal::error_handler error_handler() const { return {}; }
basic_format_arg<basic_format_context> arg(fmt::basic_string_view<charT>) const {
return {}; // unused: named arguments are not supported yet
@ -570,7 +570,7 @@ struct format_handler : fmt::internal::error_handler {
parse_ctx.check_arg_id(id);
arg = context.arg(id);
}
void on_arg_id(fmt::basic_string_view<Char> id) {}
void on_arg_id(fmt::basic_string_view<Char>) {}
void on_replacement_field(const Char* p) {
parse_ctx.advance_to(p);