summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/bugprone
Commit message (Collapse)AuthorAgeFilesLines
...
* Rename more checks from misc- to bugprone-.Alexander Kornienko2018-02-2810-0/+688
| | | | | | | | | | | | | | | | Summary: clang-tidy/rename_check.py {misc,bugprone}-string-integer-assignment clang-tidy/rename_check.py {misc,bugprone}-string-literal-with-embedded-nul clang-tidy/rename_check.py {misc,bugprone}-suspicious-enum-usage clang-tidy/rename_check.py {misc,bugprone}-suspicious-missing-comma Reviewers: hokein, sammccall, aaron.ballman Subscribers: klimek, cfe-commits, mgorny Differential Revision: https://reviews.llvm.org/D43868 llvm-svn: 326384
* Rename a few checks from misc- to bugprone-.Alexander Kornienko2018-02-2810-0/+850
| | | | | | | | | | | | | | | | | | Summary: rename_check.py {misc,bugprone}-forwarding-reference-overload rename_check.py {misc,bugprone}-macro-repeated-side-effects rename_check.py {misc,bugprone}-lambda-function-name rename_check.py {misc,bugprone}-misplaced-widening-cast Reviewers: hokein, sammccall, aaron.ballman Reviewed By: aaron.ballman Subscribers: klimek, cfe-commits, mgorny Differential Revision: https://reviews.llvm.org/D43867 llvm-svn: 326327
* [tidy] Move private ast matchers into anonymous namespaces to avoid ODR ↵Benjamin Kramer2018-02-182-0/+4
| | | | | | | | conflicts. No functionality change intended. llvm-svn: 325467
* [clang-tidy] New checker for exceptions that are created but not thrownGabor Horvath2018-02-154-0/+92
| | | | | | | | Patch by: Kristof Umann Differential Revision: https://reviews.llvm.org/D43120 llvm-svn: 325222
* Update header guard.Alexander Kornienko2018-01-311-3/+3
| | | | llvm-svn: 323871
* clang-tidy/rename_check.py misc-incorrect-roundings bugprone-incorrect-roundingsAlexander Kornienko2018-01-304-0/+114
| | | | | | | | More specifically, clang-tidy/rename_check.py misc-incorrect-roundings \ bugprone-incorrect-roundings --check_class_name IncorrectRoundings llvm-svn: 323768
* [clang-tidy] Fix DanglingHandleCheck for the correct conversion operation ↵Samuel Benzaquen2018-01-081-2/+6
| | | | | | | | | | | | | | | | between basic_string and basic_string_view. Summary: Fix DanglingHandleCheck to handle the final implementation of std::string and std::string_view. These use a conversion operator instead of a conversion constructor. Reviewers: hokein Subscribers: klimek, xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D41779 llvm-svn: 322002
* [clang-tidy] Move a few more checks from misc to bugprone.Alexander Kornienko2017-11-2421-3/+2003
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: clang_tidy/rename_check.py misc-assert-side-effect bugprone-assert-side-effect clang_tidy/rename_check.py misc-bool-pointer-implicit-conversion bugprone-bool-pointer-implicit-conversion clang_tidy/rename_check.py misc-fold-init-type bugprone-fold-init-type clang_tidy/rename_check.py misc-forward-declaration-namespace bugprone-forward-declaration-namespace clang_tidy/rename_check.py misc-inaccurate-erase bugprone-inaccurate-erase clang_tidy/rename_check.py misc-move-forwarding-reference bugprone-move-forwarding-reference clang_tidy/rename_check.py misc-multiple-statement-macro bugprone-multiple-statement-macro clang_tidy/rename_check.py misc-use-after-move bugprone-use-after-move clang_tidy/rename_check.py misc-virtual-near-miss bugprone-virtual-near-miss Manually fixed a reference to UseAfterMoveCheck in the hicpp module. Manually fixed header guards. Reviewers: hokein Reviewed By: hokein Subscribers: nemanjai, mgorny, javed.absar, xazax.hun, kbarton, cfe-commits Differential Revision: https://reviews.llvm.org/D40426 llvm-svn: 318950
* [clang-tidy] rename_check.py misc-dangling-handle bugprone-dangling-handleAlexander Kornienko2017-11-244-0/+231
| | | | | | | | | | | | Reviewers: hokein Reviewed By: hokein Subscribers: mgorny, xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D40389 llvm-svn: 318941
* [clang-tidy] rename_check.py misc-argument-comment bugprone-argument-commentAlexander Kornienko2017-11-234-0/+367
| | | | | | | | | | | | | | Summary: + manually convert the unit test to lit test. Reviewers: hokein Reviewed By: hokein Subscribers: mgorny, xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D40392 llvm-svn: 318926
* [clang-tidy] rename_check.py misc-string-constructor bugprone-string-constructorAlexander Kornienko2017-11-234-0/+177
| | | | | | | | | | | | | | | | Summary: Rename misc-string-constructor to bugprone-string-constructor + manually update the lenght of '==='s in the doc file. Reviewers: hokein, xazax.hun Reviewed By: hokein, xazax.hun Subscribers: mgorny, xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D40388 llvm-svn: 318916
* [clang-tidy] Detect bugs in bugprone-misplaced-operator-in-strlen-in-alloc ↵Adam Balogh2017-11-231-4/+17
| | | | | | | | even in the case the allocation function is called using a constant function pointer Detect bugs even if a function of the malloc() family is called using a constant pointer. llvm-svn: 318913
* [clang-tidy] Add support for operator new[] in check ↵Adam Balogh2017-11-231-2/+9
| | | | | | | | | bugprone-misplaced-operator-in-strlen-in-alloc The check now recognizes error cases like `new char[strlen(s + 1)]` and suggests a fix in the format `new char[strlen(s) + 1]`. llvm-svn: 318912
* [clang-tidy] Misplaced Operator in Strlen in AllocAdam Balogh2017-11-232-0/+129
| | | | | | | | | | | | A possible error is to write `malloc(strlen(s+1))` instead of `malloc(strlen(s)+1)`. Unfortunately the former is also valid syntactically, but allocates less memory by two bytes (if `s` is at least one character long, undefined behavior otherwise) which may result in overflow cases. This check detects such cases and also suggests the fix for them. Fix for r318906, forgot to add new files. llvm-svn: 318907
* [clang-tidy] Misplaced Operator in Strlen in AllocAdam Balogh2017-11-232-0/+4
| | | | | | | | | | A possible error is to write `malloc(strlen(s+1))` instead of `malloc(strlen(s)+1)`. Unfortunately the former is also valid syntactically, but allocates less memory by two bytes (if s` is at least one character long, undefined behavior otherwise) which may result in overflow cases. This check detects such cases and also suggests the fix for them. llvm-svn: 318906
* [clang-tidy] Fix an oversight after renaming a checkGabor Horvath2017-11-171-1/+1
| | | | llvm-svn: 318523
* [clang-tidy] Add a check for undelegated copy of base classesGabor Horvath2017-11-174-0/+161
| | | | | | | | | | | | | | | Finds copy constructors where the constructor don't call the copy constructor of the base class. ``` class X : public Copyable { X(const X &other) {} // Copyable(other) is missing }; ``` Differential Revision: https://reviews.llvm.org/D33722 llvm-svn: 318522
* [clang-tidy] bugprone-undefined-memory-manipulation: include type into the ↵Alexander Kornienko2017-08-241-7/+16
| | | | | | | | | | message Having the actual type in the message helps a lot understanding warnings in templates ;) + fix a false negative for type aliases. llvm-svn: 311651
* [clang-tidy] Add integer division checkGabor Horvath2017-08-104-0/+97
| | | | | | | | Patch by: Reka Nikolett Kovacs Differential Revision: https://reviews.llvm.org/D35932 llvm-svn: 310589
* [clang-tidy] Handle incomplete types in bugprone-undefined-memory-manipulationGabor Horvath2017-07-251-1/+2
| | | | | | | | | | check Patch by: Reka Nikolett Kovacs Differential Revision: https://reviews.llvm.org/D35790 llvm-svn: 308954
* [clang-tidy] Add bugprone-undefined-memory-manipulation checkGabor Horvath2017-07-144-0/+102
| | | | | | | | Patch by: Reka Nikolett Kovacs Differential Revision: https://reviews.llvm.org/D35051 llvm-svn: 308021
* [clang-tidy] Add bugprone-suspicious-memset-usage checkGabor Horvath2017-07-144-0/+216
Created new module bugprone and placed the check in that. Finds memset() calls with potential mistakes in their arguments. Replaces and extends the existing google-runtime-memset-zero-length check. Cases covered: * Fill value is a character '0'. Integer 0 might have been intended. * Fill value is out of char range and gets truncated. * Byte count is zero. Potentially swapped with the fill value argument. Patch by: Reka Nikolett Kovacs Differential Revision: https://reviews.llvm.org/D32700 llvm-svn: 308020
OpenPOWER on IntegriCloud