summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/bugprone/BranchCloneCheck.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [clang-tidy] Disable Checks on If constexpr statements in template ↵Nathan2020-01-231-1/+2
| | | | | | | | | | | | | | | | | | Instantiations for BugproneBranchClone and ReadabilityBracesAroundStatements Summary: fixes [[ https://bugs.llvm.org/show_bug.cgi?id=32203 | readability-braces-around-statements broken for if constexpr]] and [[ https://bugs.llvm.org/show_bug.cgi?id=44229 | bugprone-branch-clone false positive with template functions and constexpr ]] by disabling the relevant checks on if constexpr statements while inside an instantiated template. This is due to how the else branch of an if constexpr statement is folded away to a null statement if the condition evaluates to false Reviewers: alexfh, hokein, aaron.ballman, xazax.hun Reviewed By: aaron.ballman, xazax.hun Subscribers: rnkovacs, JonasToth, Jim, lebedev.ri, xazax.hun, cfe-commits Tags: #clang-tools-extra, #clang Differential Revision: https://reviews.llvm.org/D71980 (cherry picked from commit f9c46229e4ac29053747c96e08c574c6c48d544b)
* [clang-tidy] Fix crash on end location inside macroNathan Huckleberry2019-07-171-6/+11
| | | | | | | | | | | | | | | | | | | | Summary: Lexer::getLocForEndOfToken is defined to return an invalid location if the given location is inside a macro. Other checks conditionally warn based off location validity. Updating this check to do the same. Reviewers: JonasToth, aaron.ballman, nickdesaulniers Reviewed By: nickdesaulniers Subscribers: lebedev.ri, nickdesaulniers, xazax.hun, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64607 llvm-svn: 366353
* [clang-tidy] new check: bugprone-branch-cloneKristof Umann2019-05-151-0/+226
| | | | | | | | | | | | | Implement a check for detecting if/else if/else chains where two or more branches are Type I clones of each other (that is, they contain identical code) and for detecting switch statements where two or more consecutive branches are Type I clones of each other. Patch by Donát Nagy! Differential Revision: https://reviews.llvm.org/D54757 llvm-svn: 360779
* Revert "[clang-tidy] new check: bugprone-branch-clone"Jonas Toth2018-12-051-215/+0
| | | | | | | The patch broke on buildbot with assertion-failure. Revert until this is figured out. llvm-svn: 348344
* [clang-tidy] new check: bugprone-branch-cloneJonas Toth2018-12-051-0/+215
Summary: Implement a check for detecting if/else if/else chains where two or more branches are Type I clones of each other (that is, they contain identical code) and for detecting switch statements where two or more consecutive branches are Type I clones of each other. Patch by donat.nagy. Reviewers: alexfh, hokein, aaron.ballman, JonasToth Reviewed By: JonasToth Subscribers: MTC, lebedev.ri, whisperity, xazax.hun, Eugene.Zelenko, mgorny, rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D54757 llvm-svn: 348343
OpenPOWER on IntegriCloud