mirror of https://github.com/gabime/spdlog.git
Ignore a false-positive -Weffc++ operator-return value warning
Modern versions of GCC (11) mis-identify this template operator as a class assignment operator, generating repeat warnings (below) for every source file in which spdlog is included. This commit uses a pragma to prevent this false-positive from being generated. --- False positive warning follows: ../../submodules/spdlog/include/spdlog/fmt/bundled/core.h: In instantiation of ‘constexpr void fmt::v8::detail::fill_t<Char>::operator=(fmt::v8::basic_string_view<Char>) [with Char = char]’: ../../submodules/spdlog/include/spdlog/fmt/bundled/core.h:1974:17: required from ‘constexpr void fmt::v8::detail::specs_setter<Char>::on_fill(fmt::v8::basic_string_view<Char>) [with Char = char]’ ../../submodules/spdlog/include/spdlog/fmt/bundled/core.h:2146:24: required from ‘constexpr const Char* fmt::v8::detail::parse_align(const Char*, const Char*, Handler&&) [with Char = char; Handler = fmt::v8::detail::specs_checker<fmt::v8::detail::dynamic_specs_handler<fmt::v8::detail::compile_parse_context<char, fmt::v8::detail::error_handler> > >&]’ ../../submodules/spdlog/include/spdlog/fmt/bundled/core.h:2290:22: required from ‘void fmt::v8::detail::check_format_string(S) [with <template-parameter-1-1> = {unsigned int&}; S = fmt::v8::formatter<fmt::v8::detail::bigint>::format(const fmt::v8::detail::bigint&, fmt::v8::format_context&)::<lambda()>::FMT_COMPILE_STRING; typename std::enable_if<fmt::v8::is_compile_string<S>::value, int>::type <anonymous> = 0]’ ../../submodules/spdlog/include/spdlog/fmt/bundled/core.h:2849:41: required from ‘fmt::v8::basic_format_string<Char, Args>::basic_format_string(const S&) [with S = fmt::v8::formatter<fmt::v8::detail::bigint>::format(const fmt::v8::detail::bigint&, fmt::v8::format_context&)::<lambda()>::FMT_COMPILE_STRING; typename std::enable_if<std::is_convertible<const S&, fmt::v8::basic_string_view<Char> >::value, int>::type <anonymous> = 0; Char = char; Args = {unsigned int&}]’ ../../submodules/spdlog/include/spdlog/fmt/bundled/format-inl.h:2518:22: required from here ../../submodules/spdlog/include/spdlog/fmt/bundled/core.h:1879:22: warning: ‘operator=’ should return a reference to ‘*this’ [-Weffc++] 1879 | FMT_CONSTEXPR void operator=(basic_string_view<Char> s) { | ^~~~~~~~ ../../submodules/spdlog/include/spdlog/fmt/bundled/core.h:1881:66: warning: ‘operator=’ should return a reference to ‘*this’ [-Weffc++] 1881 | if (size > max_size) return throw_format_error("invalid fill");pull/2063/head
parent
5df9b11141
commit
f2ca185fdd
Loading…
Reference in New Issue