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

declaration of 'last' hides global declaration #192

Closed
johnco3 opened this issue Jun 2, 2022 · 8 comments
Closed

declaration of 'last' hides global declaration #192

johnco3 opened this issue Jun 2, 2022 · 8 comments
Labels
invalid This doesn't seem right

Comments

@johnco3
Copy link

johnco3 commented Jun 2, 2022

I found the following warning in my windows build. Looks like it has not been addressed. I renamed the inner variable last something else to work around the issue. Note that the vcpkg port also has this issue and vcpkg is not using the latest magic_enum port.

link to vcpkg issue

9>C:\Users\johnc\main\tcdu\include\702\C702Words.h(450): message : see reference to function template instantiation 'std::optional<WordID> magic_enum::enum_cast<WordID>(unsigned int) noexcept' being compiled (compiling source file ..\..\src\702\C702Protocol.cpp)
9>C:\tools\vcpkg\installed\x64-windows\include\magic_enum.hpp(763,44): error C2220: the following warning is treated as an error (compiling source file ..\..\src\702\C702SubSystem.cpp)
9>C:\tools\vcpkg\installed\x64-windows\include\magic_enum.hpp(763,44): warning C4459: declaration of 'last' hides global declaration (compiling source file ..\..\src\702\C702SubSystem.cpp)
9>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.32.31326\include\chrono(812,32): message : see declaration of 'std::chrono::last' (compiling source file ..\..\src\702\C702SubSystem.cpp)

@Neargye
Copy link
Owner

Neargye commented Jun 2, 2022

could you specify the version of the library you are using?

@johnco3
Copy link
Author

johnco3 commented Jun 2, 2022

not sure from within vcpkg, I perform a git pull before doing a build (so whatever version is at the head in vcpkg as of today). (edited June 8th 2022) In answer to your question - Verified version in vcpkg is version 8.0.0. This is 1 commit behind head - i.e. the "Fix compilation error, when including magic_enum after windows.h" commit is not included (which is also a problem, however I manually patched that)

@Neargye
Copy link
Owner

Neargye commented Jun 2, 2022

Could you show an example where this error occurs?

@schaumb
Copy link
Contributor

schaumb commented Jun 3, 2022

I think this restriction is nonsense. This means you cannot name your local (function scoped) variable as you wish, because of an other package, other namespace global variable.

@Neargye
Copy link
Owner

Neargye commented Jun 4, 2022

I think this restriction is nonsense. This means you cannot name your local (function scoped) variable as you wish, because of an other package, other namespace global variable.

It seems to me that there may be a problem with capturing the lambda context, which is why I would like to see an example.

@johnco3
Copy link
Author

johnco3 commented Jun 8, 2022

Sorry for the late response, but I added the detail over in the vcpkg site
microsoft/vcpkg#25045 (comment)

@Neargye Neargye added this to the 0.8.1 milestone Jun 16, 2022
@Neargye
Copy link
Owner

Neargye commented Jun 28, 2022

@johnco3 please test master

Neargye added a commit that referenced this issue Jun 28, 2022
@Neargye Neargye added the invalid This doesn't seem right label Jul 12, 2022
@Neargye
Copy link
Owner

Neargye commented Aug 3, 2022

Will be released, if still presents, please open new issues

@Neargye Neargye closed this as completed Aug 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

3 participants