Age | Commit message (Collapse) | Author |
|
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/branches/release_35@215017 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/branches/release_350@215007 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/branches/release_35@213603 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
has a explicit template argument.
This required a rather ugly workaround for a problem in ASTMatchers where
callee() is only overloaded for Stmt and Decl but not for Expr.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@213509 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
'final' should really be used with care.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@213501 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
This reverts commit r213308.
Reverting to have some on-list discussion/confirmation about the ongoing
direction of smart pointer usage in the LLVM project.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@213324 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@213308 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@213245 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
dependent values.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@213238 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@213233 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
The clang rewriter is now a core facility.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@213172 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
negative-sized memsets.
memset(x, -1, 0) is still useless but swapping makes no sense here. Just emit
a warning.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@213157 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
It doesn't make sense to suggest swapping the arguments here but it's
still useless code
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@213156 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
If there's memset(x, y, 0) in the code it's most likely a mistake. The
checker suggests a fix-it to swap 'y' and '0'.
I think this has the potential to be promoted into a general clang warning
after some testing in clang-tidy.
Differential Revision: http://reviews.llvm.org/D4535
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@213155 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
This change contains of two checkers that warn about
1. anonymous namespaces in header files.
2. 'using namespace' directives everywhere.
Differential Revision: http://reviews.llvm.org/D4523
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@213153 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Reviewers: bkramer
Reviewed By: bkramer
Subscribers: cfe-commits, sbenza
Differential Revision: http://reviews.llvm.org/D4534
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@213149 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@213147 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Summary:
Those are considered unsafe and should be replaced with simple pointers or
full copies. It recognizes both std::string and ::string.
Reviewers: alexfh, djasper
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D4522
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@213133 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Imagine, hypothetically, that you had a build of clang-tidy that enabled
the google-* checks by default. If you had such a binary, then this
test would fail. Making it pass in that configuration isn't such a bad
thing.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@213085 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Summary:
We still allow the escape hatch foo(int /*x*/) and also suggest this
in a fixit. This is more powerful than the corresponding cpplint.py check
it also flags functions with multiple arguments as naming all arguments is
recommended by the google style guide.
Reviewers: alexfh, djasper
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D4518
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@213075 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@213068 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
operator&
This handles both methods and freestanding overloads.
Differential Revision: http://reviews.llvm.org/D4498
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@213067 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
I checked this with Release+Asserts on x86_64-mingw32. Please restore partially if this were overkill.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@213064 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Those may be incompatible with C++11 and are unnecessary. We suggest
removing the template arguments when they match the types of the make_pair
arguments or replace it with std::pair and explicit template arguments when
not.
Differential Revision: http://reviews.llvm.org/D4497
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@213058 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212994 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
This looks for swapped arguments by looking at implicit conversions of arguments
void Foo(int, double);
Foo(1.0, 3); // Most likely a bug
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212942 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Reviewers: bkramer
Reviewed By: bkramer
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D4494
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212941 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Summary:
This patch implements a subset of possible replacements of C-style
casts with const_cast/static_cast/reinterpret_cast. This should cover a large
portion of cases in real code. Handling of a few more cases may be implemented
eventually.
Reviewers: sbenza, djasper
Reviewed By: djasper
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D4478
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212924 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212920 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212919 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
check_clang_tidy_fix.sh.
Reviewers: sbenza, djasper
Reviewed By: djasper
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D4480
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212876 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
in D4462
Reviewers: djasper, sbenza, bkramer
Reviewed By: bkramer
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D4463
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212814 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212811 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
The goal is to find code like the example below, which is likely a typo
where someone meant to write "if (*b)".
bool *b = SomeFunction();
if (b) {
// b never dereferenced
}
This checker naturally has a relatively high false positive rate so it
applies some heuristics to avoid cases where the pointer is checked for
nullptr before being written.
Differential Revision: http://reviews.llvm.org/D4458
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212797 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212755 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212658 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Summary: This reduces duplication of test code and improves locality of checks.
Reviewers: sbenza, djasper
Reviewed By: sbenza, djasper
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D4437
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212653 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212593 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212549 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212546 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
- Remove unused includes.
- Minor wording fix.
- Added support to check for clang-tidy messages to check_clang_tidy_fix.sh
= Updated test case.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212540 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Those often cause use after free bugs and should be generally avoided.
Technically it is safe to have a Twine with >=2 components in a variable
but I don't think it is a good pattern to follow. The almost trivial checker
comes with elaborated fix-it hints that turn the Twine into a std::string
if necessary and otherwise fall back to the original type if the Twine
is created from a single value.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212535 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212406 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212390 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212367 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
cygming.
This makes unittests run with BUILD_SHARED_LIBS on DLL platforms.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212316 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212271 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212270 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Summary:
This patch removes " [check-name]" from the end of
ClangTidyMessage::Message. The " [check-name]" part is only appended when
printing diagnostics on the console. Clang errors are now marked with
"clang-diagnostic-error" check name, remarks and unknown warnings are marked
with "clang-diagnostic-unknown".
Reviewers: djasper
Reviewed By: djasper
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D4356
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212180 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
access when sorting errors on output.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212042 91177308-0d34-0410-b5e6-96231b3b80d8
|