Skip to content

Commit 7f76955

Browse files
authored
Fix conflict with std::ignore (fmtlib#4356)
In situations where `using namespace std;` is used, compiler warnings can be generated because of local variables named `ignore`. This renames those variables to something else to address the name conflict.
1 parent 251320f commit 7f76955

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

include/fmt/base.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,8 @@
294294
#endif
295295

296296
#define FMT_APPLY_VARIADIC(expr) \
297-
using ignore = int[]; \
298-
(void)ignore { 0, (expr, 0)... }
297+
using unused = int[]; \
298+
(void)unused { 0, (expr, 0)... }
299299

300300
// Enable minimal optimizations for more compact code in debug mode.
301301
FMT_PRAGMA_GCC(push_options)
@@ -2729,9 +2729,9 @@ template <typename... T> struct fstring {
27292729
std::is_same<typename S::char_type, char>::value)>
27302730
FMT_ALWAYS_INLINE fstring(const S&) : str(S()) {
27312731
FMT_CONSTEXPR auto sv = string_view(S());
2732-
FMT_CONSTEXPR int ignore =
2732+
FMT_CONSTEXPR int unused =
27332733
(parse_format_string(sv, checker(sv, arg_pack())), 0);
2734-
detail::ignore_unused(ignore);
2734+
detail::ignore_unused(unused);
27352735
}
27362736
fstring(runtime_format_string<> fmt) : str(fmt.str) {}
27372737

0 commit comments

Comments
 (0)