We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The check misc-const-correctness of clang-tidy 19.0.0git (20d3815) does not work as expected for function-try-blocks.
misc-const-correctness
For the following function the warning warning variable 'i' of type 'int' can be declared 'const' [misc-const-correctness] is generated.
variable 'i' of type 'int' can be declared 'const' [misc-const-correctness]
int tp() { try { int i = 0; return i; } catch (...) { return 0; } }
When the outer curly braces are ommited, the check does not report a warning.
int fn() try { int i = 0; return i; } catch (...) { return 0; }
The text was updated successfully, but these errors were encountered:
This is because of "hasBody(compoundStmt", shouldn't be hard to fix, changing this into "hasBody(stmt" should do a trick.
Sorry, something went wrong.
cd9e42c
[clang-tidy] fix misc-const-correctness to work with function-try-blo…
26c99c4
…cks (#99925) Make the clang-tidy check misc-const-correctness work with function-try-blocks. Fixes #99860.
b1d7985
f86b5bc
…cks (#99925) Summary: Make the clang-tidy check misc-const-correctness work with function-try-blocks. Fixes #99860. Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: https://phabricator.intern.facebook.com/D60251131
Successfully merging a pull request may close this issue.
The check
misc-const-correctness
of clang-tidy 19.0.0git (20d3815) does not work as expected for function-try-blocks.For the following function the warning warning
variable 'i' of type 'int' can be declared 'const' [misc-const-correctness]
is generated.When the outer curly braces are ommited, the check does not report a warning.
The text was updated successfully, but these errors were encountered: