diff --git a/include/fmt/format.h b/include/fmt/format.h index e0c128b9..e6c649d2 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -3511,18 +3511,16 @@ FMT_END_NAMESPACE #define FMT_STRING_IMPL(s, ...) \ [] { \ - struct str : fmt::compile_string { \ + /* Use a macro-like name to avoid shadowing warnings. */ \ + struct FMT_STRING : fmt::compile_string { \ using char_type = typename std::remove_cv::type>::type>::type; \ __VA_ARGS__ FMT_CONSTEXPR \ operator fmt::basic_string_view() const { \ return {s, sizeof(s) / sizeof(char_type) - 1}; \ } \ - } result; \ - /* Suppress Qt Creator warning about unused operator. */ \ - (void)static_cast>( \ - result); \ - return result; \ + }; \ + return FMT_STRING(); \ }() /**