Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix warning generated by VS17.4 related to formattable concept #4354

Closed
wants to merge 1 commit into from

Conversation

dinomight
Copy link
Contributor

In VS17.4, the formattable local variable hides a concept of the same name. This causes a C4459 warning to be triggered. Renaming the local variable fixes the warning.

Fixes #4353

In VS17.4, the `formattable` local variable hides a concept of the same name. This causes a C4459 warning to be triggered. Renaming the local variable fixes the warning.
@vitaut
Copy link
Contributor

vitaut commented Feb 20, 2025

Please post the full warning.

@dinomight
Copy link
Contributor Author

Please post the full warning.

Here's the full output with some source paths modified slightly.

1>fmt\base.h(1653,18): error C2220: the following warning is treated as an error
1>fmt\base.h(1653,18): warning C4459: declaration of 'formattable' hides global declaration
1>fmt\base.h(2751,9): message : see declaration of 'fmt::v11::formattable'
1>fmt\base.h(1676,1): message : see reference to function template instantiation 'const Char *fmt::v11::detail::invoke_parse<const uint64_t&,Char>(fmt::v11::parse_context<Char> &)' being compiled
1>        with
1>        [
1>            Char=char
1>        ]
1>fmt\base.h(2703,1): message : see reference to function template instantiation 'fmt::v11::detail::format_string_checker<char,2,0,false>::format_string_checker<const uint64_t&,const uint16_t&>(fmt::v11::basic_string_view<char>,fmt::v11::detail::arg_pack<const uint64_t &,const uint16_t &>)' being compiled
1>source.h(30,1): message : see reference to function template instantiation 'fmt::v11::fstring<const uint64_t &,const uint16_t &>::fstring<41>(const char (&)[41])' being compiled
1>fmt\base.h(1702,20): message : while evaluating constexpr function 'fmt::v11::detail::format_string_checker<char,2,0,false>::on_format_specs'
1>fmt\base.h(1578,33): message : while evaluating constexpr function 'fmt::v11::detail::format_string_checker<char,2,0,false>::on_replacement_field'
1>fmt\base.h(1621,42): message : while evaluating constexpr function 'fmt::v11::detail::parse_replacement_field'
1>fmt\base.h(2708,53): message : while evaluating constexpr function 'fmt::v11::detail::parse_format_string'

@vitaut
Copy link
Contributor

vitaut commented Feb 21, 2025

Thanks for the PR but since doesn't look like an improvement and the false positive appears to be fixed in newer version of MSVC, I don't think we need to do anything.

@vitaut vitaut closed this Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

VS17.4: Warning generated by conflict between formattable concept and formattable local variable
2 participants