Skip to content

Conversation

@jarzec
Copy link
Contributor

@jarzec jarzec commented Jun 20, 2024

Fixes an issue causing the multiplatform build test to fail on Windows runners on GitHub.
The MSVC compiler generates a warning about a local variable shadowing a member. The warning is treated as an error in accordance with the test settings.

The Windows regression test is fixed by #1127.

Comment on lines +1514 to +1519
const std::function emit_error = [this](source_position pos, std::string_view msg) {
errors.emplace_back(pos, msg);
};
const std::function skip_error = [](source_position, std::string_view){};

const auto handle_error = emit_errors ? emit_error : skip_error;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I chose to use two lambdas to make the emit_errors == false more explicitly no-op.

@hsutter
Copy link
Owner

hsutter commented Jun 20, 2024

Thanks! Now I see that message in my local build, I must have forgotten to locally test self-build before checking that in. Thanks for the catch.

@hsutter hsutter merged commit 27590ee into hsutter:main Jun 20, 2024
@jarzec jarzec deleted the fix-shadowing-issue branch June 20, 2024 22:51
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.

2 participants