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

Library triggers bug in MSVC++ v19 (VS 2022) under modern C++ standards, preventing compilation #145

Closed
burnpanck opened this issue Nov 22, 2022 · 2 comments

Comments

@burnpanck
Copy link
Contributor

When attempting to migrate our code from VS 2019 to VS 2022, we suddenly started seeing error C2065: '<some-identifier>': undeclared identifier at four places in the library, where <some-identifier> is the name of a previous function parameter appearing within FOONATHAN_SFINAE.

With the help of the people at Stack Overflow, we deduced that this must be a bug in the compiler, as proven by the minimal failing example.

A potential workaround in this case would be to replace the references to previous function arguments in SFINAE expressions with std::declval based expressions. Would that be something this project could consider, or do we hope for a compiler fix? (the long list of bug-reports doesn't make me all too hopeful though).

@foonathan
Copy link
Owner

I'm happy to workaround, but since I don't have MSVC, it's quicker if you do a PR.

@burnpanck
Copy link
Contributor Author

Ok, I'll give it a shot. Any preferences how you would like the workaround to be implemented? Use std::declval always, use a FOONATHAN_DECLVAL instead, or conditionally select a std::declval workaround only on affected compiler versions?

burnpanck added a commit to burnpanck/memory that referenced this issue Nov 25, 2022
foonathan pushed a commit to burnpanck/memory that referenced this issue Nov 25, 2022
foonathan added a commit that referenced this issue Jan 11, 2023
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

No branches or pull requests

2 participants