summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/hicpp/SignedBitwiseCheck.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add an option to hicpp-signed-bitwise for positive integer literals.Vladimir Plyashkun2019-10-301-1/+16
| | | | | This gives developers a way to deviate from the coding standard to reduce the chattiness of the check.
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* A bit of AST matcher cleanup, NFC.Alexander Kornienko2018-11-251-20/+18
| | | | | | | | | Removed the uses of the allOf() matcher inside node matchers that are implicit allOf(). Replaced uses of allOf() with the explicit node matcher where it makes matchers more readable. Replace anyOf(hasName(), hasName(), ...) with the more efficient and readable hasAnyName(). llvm-svn: 347520
* Port getLocStart -> getBeginLocStephen Kelly2018-08-091-3/+3
| | | | | | | | | | Reviewers: javed.absar Subscribers: nemanjai, kbarton, ilya-biryukov, ioeric, jkorous, arphaman, jfb, cfe-commits Differential Revision: https://reviews.llvm.org/D50354 llvm-svn: 339400
* [clang-tidy] add missing assignment operations in hicpp-signed-bitwiseJonas Toth2018-04-111-9/+9
| | | | | | | | | | | | | This patch resolves the bug https://bugs.llvm.org/show_bug.cgi?id=36963. - implement missing assignment operators for hicpp-signed-bitwise - mention fix in release notes Reviewers: aaron.ballman, hokein, alexfh Differential: https://reviews.llvm.org/D45414 llvm-svn: 329789
* [clang-tidy] Fix bug 34845, offending standard bitmask typesJonas Toth2017-10-271-11/+49
| | | | | | | | | | | | | | | | | | | | | | | | Summary: The C++ standard allows implementations to choose the underlying type for bitmask types (e.g. std::ios_base::openmode). MSVC implemented some of them as signed integers resulting in warnings for usual code like `auto dd = std::ios_base::badbit | std::ios_base::failbit;` These false positives were reported in https://bugs.llvm.org/show_bug.cgi?id=34845 The fix allows bitwise |,&,^ for known standard bitmask types under the condition that both operands are such bitmask types. Shifting and bitwise complement are still forbidden. Reviewers: aaron.ballman, alexfh, hokein Reviewed By: aaron.ballman Subscribers: xazax.hun Differential Revision: https://reviews.llvm.org/D39099 llvm-svn: 316767
* [clang-tidy] Fix bug 34747, streaming operators and hicpp-signed-bitwiseJonas Toth2017-10-031-1/+3
| | | | | | | | | | | | The bug happened with stream operations, that were not recognized in all cases. Even there were already existing test for streaming classes, they did not catch this bug. Adding the isolated example to the existing tests did not trigger the bug. Therefore i created a new isolated file that did expose the bug indeed. Differential: https://reviews.llvm.org/D38399 reviewed by aaron.ballman llvm-svn: 314808
* [clang-tidy] hicpp bitwise operations on signed integersJonas Toth2017-08-301-0/+56
Summary: This check implements the rule [[ http://www.codingstandard.com/section/5-6-shift-operators/ | 5.6. HIC++ ]] that forbidds bitwise operations on signed integer types. Reviewers: aaron.ballman, hokein, alexfh, Eugene.Zelenko Reviewed By: aaron.ballman Subscribers: cfe-commits, mgorny, JDevlieghere, xazax.hun Differential Revision: https://reviews.llvm.org/D36586 llvm-svn: 312122
OpenPOWER on IntegriCloud