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 clang-tidy bugprone-chained-comparison warnings #2801

Merged
merged 1 commit into from
Jan 25, 2024

Conversation

ChrisThrasher
Copy link
Collaborator

@ChrisThrasher ChrisThrasher commented Jan 23, 2024

Description

This triggers when running clang-tidy's bugprone-* family of checks in code which uses Catch2 even if Catch2 headers are marked as SYSTEM headers due to how code expanded from macros is treated as first party even if the macro comes from a 3rd party library. The fix is luckily pretty straightforward.

This check is added in clang-tidy-18 due for release later this year.

llvm/llvm-project#76365

@ChrisThrasher
Copy link
Collaborator Author

CI has exploded so perhaps this is not the right fix

This triggers when running clang-tidy's bugprone-* family of checks
in code which uses Catch2 even if Catch2 headers are marked as
SYSTEM headers due to how code expanded from macros is treated as
first party even if the macro comes from a 3rd party library. The
fix is luckily pretty straightforward.

This check is added in clang-tidy-18 due for release later this year.
@ChrisThrasher ChrisThrasher force-pushed the clang-tidy-bugprone-chained-comparison branch from 0063b72 to 89c9778 Compare January 23, 2024 21:18
Copy link

codecov bot commented Jan 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (79205da) 91.37% compared to head (89c9778) 91.39%.

Additional details and impacted files
@@            Coverage Diff             @@
##            devel    #2801      +/-   ##
==========================================
+ Coverage   91.37%   91.39%   +0.02%     
==========================================
  Files         197      197              
  Lines        8285     8285              
==========================================
+ Hits         7570     7572       +2     
+ Misses        715      713       -2     

@ChrisThrasher
Copy link
Collaborator Author

Looks like we can't change the C++ to fix this and instead have to add a new suppression to deal with this. I don't love having to do this but it's worth it for providing a better user experience.

@ChrisThrasher ChrisThrasher merged commit 1078e7e into devel Jan 25, 2024
146 checks passed
@ChrisThrasher ChrisThrasher deleted the clang-tidy-bugprone-chained-comparison branch January 25, 2024 05:41
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.

1 participant