| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
As a unique_ptr or shared_ptr that has been moved from is guaranteed to be null,
we only warn if the pointer is dereferenced.
Reviewers: hokein, alexfh, aaron.ballman
Subscribers: Prazek, cfe-commits
Differential Revision: https://reviews.llvm.org/D26041
llvm-svn: 285842
|
|
|
|
|
|
|
|
| |
corresponds to the CERT C++ secure coding rule: https://www.securecoding.cert.org/confluence/display/cplusplus/MSC50-CPP.+Do+not+use+std%3A%3Arand%28%29+for+generating+pseudorandom+numbers
Patch by Benedek Kiss
llvm-svn: 285809
|
|
|
|
|
|
| |
Release notes checks order and consistent Clang-tidy readability-redundant-declaration description.
llvm-svn: 285778
|
|
|
|
|
|
|
|
|
|
|
| |
Finds redundant variable and function declarations.
extern int X;
extern int X; // <- redundant
Differential Revision: https://reviews.llvm.org/D24656
llvm-svn: 285689
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Aaron modified cert-err58-cpp to include all exceptions thrown before main()
Update the check to match.
Reviewers: aaron.ballman
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D25925
llvm-svn: 285653
|
|
|
|
| |
llvm-svn: 285645
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Avoid naked new in unique_ptr.reset() by using make_unique
Fixes http://llvm.org/PR27383
Reviewers: alexfh, aaron.ballman
Subscribers: Prazek, cfe-commits
Differential Revision: https://reviews.llvm.org/D25898
llvm-svn: 285589
|
|
|
|
| |
llvm-svn: 285581
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Extend modernize-use-auto to cases when a variable is assigned with a cast.
e.g.
Type *Ptr1 = dynamic_cast<Type*>(Ptr2);
http://llvm.org/PR25499
Reviewers: angelgarcia, aaron.ballman, klimek, Prazek, alexfh
Subscribers: Prazek, Eugene.Zelenko, cfe-commits
Tags: #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D25316
llvm-svn: 285579
|
|
|
|
|
|
| |
misc-pointer-and-integral-operation check
llvm-svn: 284894
|
|
|
|
|
|
|
| |
it detects are ill-formed (some per C++ core issue 1512, others always have
been).
llvm-svn: 284888
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: The check emits a warning if a member-initializer calls the member's default constructor with no arguments.
Reviewers: sbenza, alexfh, aaron.ballman
Subscribers: modocache, mgorny, Eugene.Zelenko, etienneb, Prazek, hokein, cfe-commits, beanz
Differential Revision: https://reviews.llvm.org/D24339
llvm-svn: 284742
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: This adds cert-err09-cpp alias for completeness, similar to cert-err61-cpp.
Reviewers: alexfh, hokein
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D25770
llvm-svn: 284596
|
|
|
|
| |
llvm-svn: 283865
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: aaron.ballman
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D25244
llvm-svn: 283777
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
General overhaul to fix many coding bugs, simplify the code, and improve readability.
* Clarify documentation strings of user options.
* Say that clang-include-fixer-executable is a file to have auto completion.
* Allow user to select available options for clang-include-fixer-input-format. Turn it into a symbol as it's not a free-form string.
* Remove clang-include-fixer-query-mode. This option was apparently used to select between two different operation modes, which is not a typical use case for user options. Provide two separate commands instead.
* Add a face for the overlay highlighting so that users can customize it.
Move user commands to the front so that readers of the code aren't buried in internal functions.
* Make process calls asynchronous. This is possible here because clang-include-fixer doesn't change files in place. This means input is no longer blocked while clang-include-fixer is running.
* Factor out logic in helper functions to keep functions short.
* Add comments where appropriate.
* Provide an alternative buffer replacement strategy for the case that a single line was inserted (the normal case in the case of clang-include-fixer). This keeps point, markers, and other buffer information intact.
* Use let-alist and association lists instead of property lists to shorten the code.
* Instead of highlighting only the first occurrence of a symbol, highlight all occurrences and move point to the closest one.
* Detect qualified names at point.
* Use filepos-to-bufferpos if available.
* Formatting.
Patch by Philipp Stephani!
llvm-svn: 283306
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: bkramer
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D24719
llvm-svn: 282480
|
|
|
|
| |
llvm-svn: 282158
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Having both rename-at and rename-all both seems confusing and introduces
unneeded difficulties. After merging rename-at and rename-all maintaining main
function wrappers and custom help becomes redundant while CLI becomes less
confusing.
D24224 (which was the original patch causing buildbot failures) wasn't aware of
bugs caused by passing both -offset and -qualified-name. After D24224 was landed
it caused buildbot failures and therefor I just reverted it.
Two things that make this patch different from D24224 are:
* unittests/clang-rename was deleted, because it is unmaintained and doesn't do
much.
* Passing both `-offset` and `-qualified-name` isn't allowed anymore for the
sake of preventing bugs.
This patch is a trivial enhancement of accepted D24224 revision.
Tested with `ninja check-all`.
Differential Revision: https://reviews.llvm.org/D24567
llvm-svn: 281710
|
|
|
|
|
|
| |
Differential revision: https://reviews.llvm.org/D24526
llvm-svn: 281510
|
|
|
|
| |
llvm-svn: 281459
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Having both rename-at and rename-all both seems confusing and introduces
unneeded difficulties. Allowing to use both -qualified-name and -offset at once
while performing efficient renamings seems like a feature, too. Maintaining main
function wrappers and custom help becomes redundant while CLI becomes less
confusing.
Reviewers: alexfh
Differential Revision: https://reviews.llvm.org/D24224
llvm-svn: 281456
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The check warns if an object is used after it has been moved, without an
intervening reinitialization.
See user-facing documentation for details.
Reviewers: sbenza, Prazek, alexfh
Subscribers: beanz, mgorny, shadeware, omtcyfz, Eugene.Zelenko, Prazek, fowles, ioeric, cfe-commits
Differential Revision: https://reviews.llvm.org/D23353
llvm-svn: 281453
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
size() and empty()
This patch extends readability-container-size-empty check allowing it to produce
warnings not only for STL containers, but also for containers, which provide two
functions matching following signatures:
* `size_type size() const;`
* `bool empty() const;`
Where `size_type` can be any kind of integer type.
This functionality was proposed in https://llvm.org/bugs/show_bug.cgi?id=26823
by Eugene Zelenko.
Approval: alexfh
Reviewers: alexfh, aaron.ballman, Eugene.Zelenko
Subscribers: etienneb, Prazek, hokein, xazax.hun, cfe-commits
Differential Revision: https://reviews.llvm.org/D24349
llvm-svn: 281307
|
|
|
|
|
|
|
|
|
|
| |
when array index is misplaced.
Reviewers: alexfh
Differential Revision: https://reviews.llvm.org/D21134
llvm-svn: 281206
|
|
|
|
|
|
| |
Differential revision: https://reviews.llvm.org/D24201
llvm-svn: 280725
|
|
|
|
| |
llvm-svn: 280539
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: alexfh, Eugene.Zelenko, aaron.ballman
Subscribers: aaron.ballman, cfe-commits
Differential Revision: https://reviews.llvm.org/D23918
llvm-svn: 280236
|
|
|
|
| |
llvm-svn: 280235
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Bugfix for 27321. When the constructor of stored pointer
type is private then it is invalid to change it to
make_shared or make_unique.
Reviewers: alexfh, aaron.ballman, hokein
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D23343
llvm-svn: 280180
|
|
|
|
| |
llvm-svn: 280119
|
|
|
|
| |
llvm-svn: 280095
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The check emits a warning if std::move() is applied to a forwarding reference, i.e. an rvalue reference of a function template argument type.
If a developer is unaware of the special rules for template argument deduction on forwarding references, it will seem reasonable to apply std::move() to the forwarding reference, in the same way that this would be done for a "normal" rvalue reference.
This has a consequence that is usually unwanted and possibly surprising: If the function that takes the forwarding reference as its parameter is called with an lvalue, that lvalue will be moved from (and hence placed into an indeterminate state) even though no std::move() was applied to the lvalue at the callsite.
As a fix, the check will suggest replacing the std::move() with a std::forward().
This patch requires D23004 to be submitted before it.
Reviewers: sbenza, aaron.ballman
Subscribers: klimek, etienneb, alexfh, aaron.ballman, Prazek, Eugene.Zelenko, mgehre, cfe-commits
Projects: #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D22220
llvm-svn: 280077
|
|
|
|
| |
llvm-svn: 279944
|
|
|
|
|
|
| |
Differential revision: https://reviews.llvm.org/D23894
llvm-svn: 279846
|
|
|
|
|
|
|
|
| |
* Implement missing storeOption interfaces.
* Remove unnecessary parameter copy in isHeaderFileExtension.
* Fix doc style.
llvm-svn: 279814
|
|
|
|
|
|
|
|
| |
Changed the extension check to include the option of ",h,hh,hpp,hxx" instead of just returning whether the file ended with ".h".
Differential revision: https://reviews.llvm.org/D20512
llvm-svn: 279803
|
|
|
|
|
|
| |
Differential revision: https://reviews.llvm.org/D23815
llvm-svn: 279659
|
|
|
|
| |
llvm-svn: 279541
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
function parameters should be const
The check will warn when the constness will make the function interface safer.
Reviewers: alexfh
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D15332
llvm-svn: 279507
|
|
|
|
|
|
| |
Differential revision: https://reviews.llvm.org/D23728
llvm-svn: 279494
|
|
|
|
| |
llvm-svn: 279442
|
|
|
|
| |
llvm-svn: 279170
|
|
|
|
|
|
| |
+ random fixes
llvm-svn: 279115
|
|
|
|
| |
llvm-svn: 279051
|
|
|
|
| |
llvm-svn: 279050
|
|
|
|
| |
llvm-svn: 279049
|
|
|
|
| |
llvm-svn: 279009
|
|
|
|
|
|
|
|
| |
clang-tidy/index.rst.
Differential revision: https://reviews.llvm.org/D23596
llvm-svn: 279006
|
|
|
|
|
|
|
|
| |
Use table to avoid tautology. List all existing checks groups. Use alphabetical order.
Differential revision: https://reviews.llvm.org/D23471
llvm-svn: 278686
|