| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
| |
llvm-svn: 246444
|
| |
|
|
|
|
|
|
|
| |
"modernize/"
These checks are focusing on migrating the code from C++98/03 to C++11, so they
belong to the modernize module.
llvm-svn: 246437
|
| |
|
|
| |
llvm-svn: 246325
|
| |
|
|
|
|
| |
checkers do not require additional testing as the tests will not compile for other languages or modes, or the checkers would never match a valid construct.
llvm-svn: 246318
|
| |
|
|
|
|
|
|
|
|
|
| |
Changes mostly address formatting and unification of the style. Use
MarkDown style for inline code snippets and lists. Added some text
for a few checks.
The idea is to move most of the documentation out to separate rST files and have
implementation files refer to the corresponding documentation files.
llvm-svn: 246169
|
| |
|
|
|
|
| |
constructor initializations that call copy constructors instead of move constructors.
llvm-svn: 245571
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The existing check converts the code pattern below:
void f()
{
}
to:
void f()
override {
}
which is fairly sub-optimal. This patch fixes this by inserting the
override keyword on the same line as the function declaration if
possible, so that we instead get:
void f() override
{
}
We do this by looking for the last token before the start of the body
and inserting the override keyword at the end of its location. Note
that we handle const, volatile and ref-qualifiers correctly.
Test Plan: Includes an automated test.
Reviewers: alexfh
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D9286
llvm-svn: 245401
|
| |
|
|
| |
llvm-svn: 245310
|
| |
|
|
|
|
| |
can leave out the parameter list.
llvm-svn: 245048
|
| |
|
|
|
|
| |
We couldn't calculate the removal ranges properly at this point.
llvm-svn: 244454
|
| |
|
|
|
|
| |
"this namespace alias decl is unused" -> "namespace alias decl '...' is unused"
llvm-svn: 243906
|
| |
|
|
|
|
| |
commit review.
llvm-svn: 243871
|
| |
|
|
| |
llvm-svn: 243773
|
| |
|
|
|
|
|
| |
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
|