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 #13550 Remove boostForeachError/checkboost.cpp #7198

Merged
merged 13 commits into from
Jan 13, 2025

Conversation

chrchr-github
Copy link
Collaborator

No description provided.

@chrchr-github chrchr-github changed the title Fix #13472, #13516 FP unreachableCode (GNU inline function, custom loop macro) Bail out for unknown loop macros and GNU inline functions Jan 9, 2025
@chrchr-github
Copy link
Collaborator Author

chrchr-github commented Jan 9, 2025

We should probably just simplify BOOST_FOREACH to a range-based loop and do away with checkboost.cpp (already exists in boost.cfg).

@chrchr-github
Copy link
Collaborator Author

If we really want to support MSVC's for each (never heard of it), it should also be simplified better.
https://learn.microsoft.com/en-us/cpp/dotnet/for-each-in?view=msvc-170

@chrchr-github
Copy link
Collaborator Author

if (Token::simpleMatch(tok, "for each")) {
// 'for each ( )' -> 'asm ( )'
tok->str("asm");
// 'for each (x in y )' -> 'for (x : y)'
Copy link
Collaborator

Choose a reason for hiding this comment

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

That's C++11 code. Does that work if we are using C++03 as standard?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't think we have any loop-handling code that is conditional on the standard. Also, the new simplification can only be an improvement on the asm hack.

Copy link
Collaborator

@firewave firewave Jan 9, 2025

Choose a reason for hiding this comment

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

Definitely - especially since we are handling asm so well. It also now matches what the library configurations are doing.

@chrchr-github
Copy link
Collaborator Author

The test cases involving std::set are invalid, since it has stable insert/erase.

@chrchr-github chrchr-github changed the title Bail out for unknown loop macros and GNU inline functions Fix #13550 Remove boostForeachError/checkboost.cpp Jan 12, 2025
@chrchr-github chrchr-github marked this pull request as ready for review January 13, 2025 09:08
@chrchr-github
Copy link
Collaborator Author

There are no instances of boostForeachError in daca, so the impact should be minimal:
http://cppcheck1.osuosl.org:8000/head-boostForeachError

@chrchr-github chrchr-github merged commit 6ee9633 into danmar:main Jan 13, 2025
60 checks passed
@chrchr-github chrchr-github deleted the chr_13472 branch January 13, 2025 15:24
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