fix GCC 7,8,9 warning about unused but set parameter (#2177)

This commit is contained in:
Alexey Ochapov 2021-03-13 17:36:53 +03:00 committed by GitHub
parent d28101878a
commit c8d8b88223
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -557,9 +557,10 @@ template <typename Char> struct runtime_named_field {
basic_string_view<Char> name;
template <typename OutputIt, typename T>
constexpr static bool try_format_argument(OutputIt& out,
basic_string_view<Char> arg_name,
const T& arg) {
constexpr static bool try_format_argument(
OutputIt& out,
// [[maybe_unused]] due to unused-but-set-parameter warning in GCC 7,8,9
[[maybe_unused]] basic_string_view<Char> arg_name, const T& arg) {
if constexpr (is_named_arg<typename std::remove_cv<T>::type>::value) {
if (arg_name == arg.name) {
out = write<Char>(out, arg.value);