Fixed issues preventing compilation on VS 2022 17.1. #2000
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For some reason1, Visual Studio 2022's newest update (17.1.0) made source breaking changes to the C++ compiler. In two instances, these prevented winget from compiling. I believe @yao-msft was running into these issues in #1990, but here's the fix.
Basically, there was a conformance change to the compiler where if you had a
static_assert
that could be evaluated without knowing the type, then the compiler would always evaluate it to the same value. Many of thestatic_assert
calls that were checking to see if a type had an override had to be made dependent on the type so the compiler wouldn't optimize the check away.More reading here: https://docs.microsoft.com/en-us/cpp/overview/cpp-conformance-improvements?view=msvc-170#error-on-a-non-dependent-static_assert
Microsoft Reviewers: Open in CodeFlow
Footnotes
Most likely because engagement with the 17.0 error list was too low ;) ↩