This changeset still emits the diagnostic that the expression could be simplified, but it doesn't generate any fix-its that would lose comments or preprocessor directives within the text that would be replaced.
Fixes PR25842
Paths
| Differential D15737
[clang-tidy] Preserve comments and preprocessor directives when simplifying boolean expressions ClosedPublic Authored by LegalizeAdulthood on Dec 22 2015, 8:48 PM.
Details Summary This changeset still emits the diagnostic that the expression could be simplified, but it doesn't generate any fix-its that would lose comments or preprocessor directives within the text that would be replaced. Fixes PR25842
Diff Detail Event TimelineLegalizeAdulthood retitled this revision from to [clang-tidy] Preserve comments and preprocessor directives when simplifying boolean expressions. LegalizeAdulthood updated this object. Comment Actions Thank you for the fix. See the comments inline.
LegalizeAdulthood edited edge metadata. LegalizeAdulthood marked 6 inline comments as done. Comment ActionsUpdate from review comments alexfh edited edge metadata. Comment ActionsThanks! Looks good with one nit. Do you need me to commit the patch for you?
This revision is now accepted and ready to land.Dec 28 2015, 4:39 AM Comment Actions
Assuming "yes", since I don't recall any patches committed by you. Actually, it might be a good idea for you to request commit access at this point. Closed by commit rL256492: [clang-tidy] Preserve comments and preprocessor directives when simplifying… (authored by alexfh). · Explain WhyDec 28 2015, 5:24 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 43647 clang-tidy/readability/SimplifyBooleanExprCheck.h
clang-tidy/readability/SimplifyBooleanExprCheck.cpp
test/clang-tidy/readability-simplify-bool-expr.cpp
|
The range should be converted to file char range before passing it to FixItHint::CreateReplacement, otherwise the fix may be applied incorrectly (or not applied at all). So please move this call to issueDiag and pass a CharSourceRange here.