| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
llvm-svn: 282158
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: alexfh, Eugene.Zelenko, aaron.ballman
Subscribers: aaron.ballman, cfe-commits
Differential Revision: https://reviews.llvm.org/D23918
llvm-svn: 280236
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
...
This check verifies if a buffer passed to an MPI (Message Passing Interface)
function is sufficiently dereferenced. Buffers should be passed as a single
pointer or array. As MPI function signatures specify void * for their buffer
types, insufficiently dereferenced buffers can be passed, like for example
as double pointers or multidimensional arrays, without a compiler warning
emitted.
Instructions on how to apply the check can be found at:
https://github.com/0ax1/MPI-Checker/tree/master/examples
Reviewers: Haojian Wu
Differential revision: https://reviews.llvm.org/D22729
llvm-svn: 278553
|
|
|
|
|
|
| |
readability-else-after-return description spotted by Alexander Kornienko.
llvm-svn: 278279
|
|
|
|
|
|
| |
Clang-tidy readability-else-after-return description.
llvm-svn: 278263
|
|
|
|
|
|
|
|
|
|
|
|
| |
`readability-else-after-return` only warns about `return` calls, but LLVM Coding
Standars stat that `throw`, `continue`, `goto`, etc after `return` calls are
bad, too.
Reviwers: alexfh, aaron.ballman
Differential Revision: https://reviews.llvm.org/D23265
llvm-svn: 278257
|
|
|
|
|
|
| |
Alexander Kornienko.
llvm-svn: 278255
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch introduces a minor list of changes as proposed by Richard Smith in
the mailing list.
See original comments with an impact on the future check state below:
[comments.begin
> + {"complex.h", "ccomplex"},
It'd be better to convert this one to <complex>, or leave it alone.
<ccomplex> is an unnecessary wart.
(The contents of C++11's <complex.h> / <ccomplex> / <complex> (all of
which are identical) aren't comparable to C99's <complex.h>, so if
this was C++98 code using the C99 header, the code will be broken with
or without this transformation.)
> + {"iso646.h", "ciso646"},
Just delete #includes of this one. <ciso646> does nothing.
> + {"stdalign.h", "cstdalign"},
> + {"stdbool.h", "cstdbool"},
We should just delete these two includes. These headers do nothing in C++.
comments.end]
Reviewers: alexfh, aaron.ballman
Differential Revision: https://reviews.llvm.org/D17990
llvm-svn: 278254
|
|
|
|
| |
llvm-svn: 278198
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
modernize-use-bool-literals doesn't checks operands in ternary operator.
For example:
``` c++
static int Value = 1;
bool foo() {
bool Result = Value == 1 ? 1 : 0;
return Result;
}
bool boo() {
return Value == 1 ? 1 : 0;
}
```
This issue was reported in bug 28854. The patch fixes it.
Reviewers: alexfh, aaron.ballman, Prazek
Subscribers: Prazek, Eugene.Zelenko
Differential Revision: https://reviews.llvm.org/D23243
llvm-svn: 278022
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The misc-argument-comment check now ignores leading and trailing underscores and
case. The new `StrictMode` local/global option can be used to switch back to
strict checking.
Add getLocalOrGlobal version for integral types, minor cleanups.
Reviewers: hokein, aaron.ballman
Subscribers: aaron.ballman, Prazek, cfe-commits
Differential Revision: https://reviews.llvm.org/D23135
llvm-svn: 277729
|
|
|
|
|
|
|
|
| |
Patch by Bittner Barni!
Differential revision: https://reviews.llvm.org/D20196
llvm-svn: 277677
|
|
|
|
|
|
|
|
|
|
| |
alexfh raised a concern with https://reviews.llvm.org/rL277340
After retabbing indentation of .. code-block:: was increased to 8, 4 spaces
indentation should be enough.
Reviewers: alexfh
llvm-svn: 277577
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This check verifies if buffer type and MPI (Message Passing Interface)
datatype pairs match. All MPI datatypes defined by the MPI standard (3.1)
are verified by this check. User defined typedefs, custom MPI datatypes and
null pointer constants are skipped, in the course of verification.
Instructions on how to apply the check can be found at:
https://github.com/0ax1/MPI-Checker/tree/master/examples
Patch by Alexander Droste!
Differential revision: https://reviews.llvm.org/D21962
llvm-svn: 277516
|
|
|
|
| |
llvm-svn: 277340
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Check for classes that violate the rule of five and zero as specified in CppCoreGuidelines:
"If a class defines or deletes a default operation then it should define or delete them all."
https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#c21-if-you-define-or-delete-any-default-operation-define-or-delete-them-all.
Reviewers: alexfh, sbenza, aaron.ballman
Subscribers: Prazek, Eugene.Zelenko, cfe-commits, ericLemanissier, nemanjai
Projects: #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D22513
llvm-svn: 277262
|
|
|
|
|
|
|
|
| |
Not everything is valid, but it should works for 99.8% cases
https://reviews.llvm.org/D22208
llvm-svn: 277097
|
|
|
|
| |
llvm-svn: 276861
|