diff --git a/include/fmt/format.h b/include/fmt/format.h index 35b9c1c5..4c8e32b7 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -2178,8 +2178,8 @@ template struct arg_ref { arg_id_kind kind; union value { - FMT_CONSTEXPR value() : index(0u) {} - FMT_CONSTEXPR value(int id) : index(id) {} + FMT_CONSTEXPR value() : index{0u} {} + FMT_CONSTEXPR value(int id) : index{id} {} FMT_CONSTEXPR value(basic_string_view n) : name(n) {} int index; diff --git a/test/format-test.cc b/test/format-test.cc index 67eb9be8..f5a35569 100644 --- a/test/format-test.cc +++ b/test/format-test.cc @@ -20,8 +20,14 @@ # include #endif +// Check if fmt/format.h compiles with the X11 index macro defined. +#define index(x, y) no nice things + #include "fmt/color.h" #include "fmt/format.h" + +#undef index + #include "gmock.h" #include "gtest-extra.h" #include "mock-allocator.h"