| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
| |
alias declarations. In the future, we might want to reuse it to also
fine unsed using declarations and such.
llvm-svn: 243754
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
misc-inefficient-algorithm
Summary:
Support replacements in macro arguments in the
misc-inefficient-algorithm check.
Reviewers: klimek
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D11677
llvm-svn: 243747
|
|
|
|
|
|
|
| |
In headers, they might always be pulled in to different TUs, even if
they are declared static or nested in an unnamed namespace.
llvm-svn: 243414
|
|
|
|
|
|
| |
Not sure why I wrote what I wrote before.
llvm-svn: 243403
|
|
|
|
|
|
|
|
|
| |
As there don't seem to be a good way of formulating a matcher that
finds all pairs of functions and their ParmVarDecls, just match on
functionDecls and iterate over their parameters. This should also be
more efficient as some checks are only performed once per function.
llvm-svn: 243267
|
|
|
|
|
|
| |
ParmVarDecls of function types.
llvm-svn: 243026
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The parameters of the function templates were being marked as
incorrectly be marked as unused. Added a test for this and changed the
check to use the same
isReferenced() || !getDeclName()
logic as Sema::DiagnoseUnusedParameters.
Patch Scott Wallace, thank you!
llvm-svn: 242912
|
|
|
|
|
|
| |
Also see: llvm.org/PR24180.
llvm-svn: 242659
|
|
|
|
|
|
| |
Also see: llvm.org/PR24180.
llvm-svn: 242654
|
|
|
|
|
|
|
|
|
|
|
| |
Enhance clang-tidy misc-macro-repeated-side-effects to handle ? and : better.
When ? is used in a macro, there are 2 possible control flow paths through the macro.
These paths are tracked separately so problems can be detected properly.
http://reviews.llvm.org/D10653
llvm-svn: 241245
|
|
|
|
| |
llvm-svn: 241160
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
There were false positives in C++ code where macro argument was a type.
Reviewers: alexfh
Differential Revision: http://reviews.llvm.org/D10801
llvm-svn: 240938
|
|
|
|
| |
llvm-svn: 240399
|
|
|
|
|
|
| |
Clang was warning on this.
llvm-svn: 239988
|
|
|
|
|
|
| |
repeated in the macro
llvm-svn: 239909
|
|
|
|
|
|
| |
violations.
llvm-svn: 239904
|
|
|
|
|
|
|
| |
* calculations in the replacement list should be inside parentheses
* macro arguments should be inside parentheses
llvm-svn: 239820
|
|
|
|
|
|
| |
misc-static-assert and misc-assert-side-effect will handle __builtin_expect based asserts correctly.
llvm-svn: 238548
|
|
|
|
| |
llvm-svn: 238326
|
|
|
|
|
|
| |
and assignments.
llvm-svn: 238202
|
|
|
|
|
|
| |
misc-static-assert won't report asserts whose conditions contain calls to non constexpr functions.
llvm-svn: 238098
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Add a clang-tidy check (misc-noexcept-move-ctors) for move constructors
and assignment operators not using noexcept.
http://llvm.org/PR23519
Reviewers: klimek
Reviewed By: klimek
Subscribers: curdeius, cfe-commits
Differential Revision: http://reviews.llvm.org/D9933
llvm-svn: 238013
|
|
|
|
|
|
|
| |
This solves some false negatives at a cost of adding some false positives that
can be fixed easily and (almost) automatically.
llvm-svn: 237120
|
|
|
|
|
|
|
|
|
|
| |
The misc-static-assert check will not warn on the followings:
assert(NULL == "shouldn't warn");
assert(__null == "shouldn't warn");
Where NULL is a macro defined as __null.
llvm-svn: 236812
|
|
|
|
|
|
|
|
| |
The misc-static-assert check will not warn on the followings:
assert("Some message" == NULL);
assert(NULL == "Some message");
llvm-svn: 234596
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Do not warn on .reset(.release()) expressions if the deleters are not
compatible.
Using plain assignment will probably not work.
Reviewers: klimek
Subscribers: curdeius, cfe-commits
Differential Revision: http://reviews.llvm.org/D8422
llvm-svn: 234512
|
|
|
|
|
|
|
|
|
|
| |
Followup to http://reviews.llvm.org/D8465, which would break a test in
clang-tidy. clang-tidy previously assumes that source locations of
defaulted/deleted members are (incorrectly) not including the '= ...' part.
Differential Revision: http://reviews.llvm.org/D8466
llvm-svn: 233032
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
http://llvm.org/PR22880
The misc-static-assert check will not warn on assert(false), assert(False),
assert(FALSE); where false / False / FALSE are macros expanding to the false or
0 literals.
Also added corresponding test cases.
http://reviews.llvm.org/D8328
Patch by Szabolcs Sipos!
llvm-svn: 232306
|
|
|
|
|
|
|
|
|
|
| |
The patch was generated using this command:
$ clang-tidy/tool/run-clang-tidy.py -header-filter=.*clang-tidy.* -fix \
-checks=-*,llvm-header-guard clang-tidy.*
$ svn revert --recursive clangt-tidy/llvm/
(to revert a few buggy fixes)
llvm-svn: 231669
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
follow naming conventions
Classes are named WhateverCheck, files are named WhateverCheck.cpp and
WhateverCheck.h.
http://reviews.llvm.org/D8145
Patch by Richard Thomson!
llvm-svn: 231648
|
|
|
|
| |
llvm-svn: 231620
|
|
|
|
|
|
|
|
|
|
| |
right side is rvalue
http://reviews.llvm.org/D8071
Patch by Alexey Sokolov!
llvm-svn: 231365
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
clang::tidy::misc
clang-tidy checks are organized into modules. This refactoring moves the misc
module checks into the namespace clang::tidy::misc
http://reviews.llvm.org/D7996
Patch by Richard Thomson!
llvm-svn: 230950
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch contains two assert related checkers. These checkers are the part of
those that is being open sourced by Ericsson
(http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-December/040520.html).
The checkers:
AssertSideEffect:
/// \brief Finds \c assert() with side effect.
///
/// The conition of \c assert() is evaluated only in debug builds so a condition
/// with side effect can cause different behaviour in debug / relesase builds.
StaticAssert:
/// \brief Replaces \c assert() with \c static_assert() if the condition is
/// evaluatable at compile time.
///
/// The condition of \c static_assert() is evaluated at compile time which is
/// safer and more efficient.
http://reviews.llvm.org/D7375
Patch by Szabolcs Sipos!
llvm-svn: 230943
|
|
|
|
|
|
|
|
|
|
|
| |
* Better error message when more than one of 'virtual', 'override' and 'final'
is present ("X is/are redundant since the function is already declared Y").
* Convert the messages to the style used in Clang diagnostics: lower case
initial letter, no trailing period.
* Don't run the check for files compiled in pre-C++11 mode
(http://llvm.org/PR22638).
llvm-svn: 230765
|
|
|
|
| |
llvm-svn: 230483
|
|
|
|
| |
llvm-svn: 229552
|
|
|
|
| |
llvm-svn: 228945
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Algorithms like remove() does not actually remove any element from the
container but returns an iterator to the first redundant element at the end
of the container. These redundant elements must be removed using the
erase() method. This check warns when not all of the elements will be
removed due to using an inappropriate overload.
Reviewer: alexfh
Differential Revision: http://reviews.llvm.org/D7496
llvm-svn: 228679
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Warn when the return type of assign operators is not Class&.
Reviewers: alexfh
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D6667
llvm-svn: 228583
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Associative containers implements some of the algorithms as methods which
should be preferred to the algorithms in the algorithm header. The methods
can take advantage of the order of the elements.
Reviewers: alexfh
Reviewed By: alexfh
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D7246
llvm-svn: 228505
|
|
|
|
|
|
|
| |
No functionality changed, this is just a mechanical cleanup to keep the
order of #include lines consistent across the project.
llvm-svn: 225976
|
|
|
|
|
|
|
|
|
|
| |
Before:
void f() __attribute__((override unused))
After:
void f() override __attribute__((unused))
llvm-svn: 225519
|
|
|
|
|
|
|
|
|
|
|
| |
Replace x.reset(y.release()); with x = std::move(y);
If y is rvalue, replace with x = y; instead.
http://reviews.llvm.org/D6485
Patch by Alexey Sokolov!
llvm-svn: 223460
|
|
|
|
|
|
| |
Apparently attributes aren't sorted by source location.
llvm-svn: 222751
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Register readability checks in a separate module. Renamed the checks
and test file names accordingly.
Reviewers: djasper, klimek
Reviewed By: klimek
Subscribers: curdeius, cfe-commits
Differential Revision: http://reviews.llvm.org/D5936
llvm-svn: 220631
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Some of the misc checks belong to readability/. I'm moving them there
without changing check names for now. As the next step, I want to register some
of these checks in the google and llvm modules with suitable settings (e.g.
BracesAroundStatementsCheck). I'm not sure if we want to create a "readability"
module, probably not.
Reviewers: djasper
Reviewed By: djasper
Subscribers: curdeius, cfe-commits
Differential Revision: http://reviews.llvm.org/D5792
llvm-svn: 219786
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add option ShortStatementLines to trigger this check only if the statement spans
over at least a given number of lines.
Modifications from the original patch:
merged test/clang-tidy/misc-braces-around-statements-always.cpp into
test/clang-tidy/misc-braces-around-statements.cpp and removed unnecessary
CHECK-NOTs from the tests.
http://reviews.llvm.org/D5642
Patch by Marek Kurdej!
llvm-svn: 219611
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This check looks for if statements and loops: for, range-for, while and
do-while, and verifies that the inside statements are inside braces '{}'.
If not, proposes to add braces around them.
Example:
if (condition)
action();
becomes
if (condition) {
action();
}
This check ought to be used with the -format option, so that the braces be
well-formatted.
Patch by Marek Kurdej!
http://reviews.llvm.org/D5395
llvm-svn: 218898
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As this is very dependent on the code base it has some ways of configuration.
It's possible to pick between 3 modes of operation:
- Line counting: number of lines including whitespace and comments
- Statement counting: number of statements within compoundStmts.
- Branch counter
In addition a threshold can be picked, warnings are only emitted when it is met.
The thresholds can be configured via a .clang-tidy file.
Differential Revision: http://reviews.llvm.org/D4986
llvm-svn: 217768
|