| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D27700
llvm-svn: 290489
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
An addition to the move-constructor-init check was duplicating the
modernize-pass-by-value check.
Remove the additional check and UseCERTSemantics option.
Run the move-constructor-init test with both checks enabled.
Fix modernize-pass-by-value false-positive when initializing a base
class.
Add option to modernize-pass-by-value to only warn about parameters
that are already values.
Reviewers: alexfh, flx, aaron.ballman
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D26453
llvm-svn: 290051
|
|
|
|
| |
llvm-svn: 289656
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
At least the plugin used by the LibreOffice build
(<https://wiki.documentfoundation.org/Development/Clang_plugins>) indirectly
uses those members (through inline functions in LLVM/Clang include files in turn
using them), but they are not exported by utils/extract_symbols.py on Windows,
and accessing data across DLL/EXE boundaries on Windows is generally
problematic.
Differential Revision: https://reviews.llvm.org/D26671
llvm-svn: 289647
|
|
|
|
| |
llvm-svn: 289542
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Ran clang-format on all .c/.cpp/.h files in clang-tools-extra.
Excluded the test, unittests, clang-reorder-fields, include-fixer, modularize and pptrace directories.
Reviewers: klimek, alexfh
Subscribers: nemanjai
Tags: #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D26329
llvm-svn: 286221
|
|
|
|
| |
llvm-svn: 286213
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
PVS-Studio
Also fix some Include What You Use and modernize-use-bool-literals warnings.
Differential revision: https://reviews.llvm.org/D26176
llvm-svn: 285721
|
|
|
|
|
|
|
| |
it detects are ill-formed (some per C++ core issue 1512, others always have
been).
llvm-svn: 284888
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This adds a diagnostic to the misc-use-after-move check that is output when the
use happens on a later loop iteration than the move, for example:
A a;
for (int i = 0; i < 10; ++i) {
a.foo();
std::move(a);
}
This situation can be confusing to users because, in terms of source code
location, the use is above the move. This can make it look as if the warning
is a false positive, particularly if the loop is long but the use and move are
close together.
In cases like these, misc-use-after-move will now output an additional
diagnostic:
a.cpp:393:7: note: the use happens in a later loop iteration than the move
Reviewers: hokein
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D25612
llvm-svn: 284235
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
* Fix a false postive when an using class is used in an explicit template instantiation.
* Fix a false postive when an using template class is used as template argument.
Reviewers: aaron.ballman
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D25437
llvm-svn: 283879
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D24881
llvm-svn: 282319
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This is needed for the recently submitted misc-use-after-move check (rL281453).
For some reason, this still built under Linux, but it caused the PPC build bot
to fail.
Subscribers: beanz, cfe-commits, mgorny
Differential Revision: https://reviews.llvm.org/D24561
llvm-svn: 281460
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
alternative solution
llvm-svn: 279666
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
function call expression.
Summary:
The check doesn't mark the template argument as used when the template
argument is a template.
Reviewers: djasper, alexfh
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D22803
llvm-svn: 277444
|
|
|
|
| |
llvm-svn: 277340
|
|
|
|
|
|
| |
This reverts rL276746.
llvm-svn: 276752
|
|
|
|
| |
llvm-svn: 276746
|
|
|
|
|
|
|
|
|
|
|
|
| |
templated function.
Reviewers: alexfh, aaron.ballman
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D22260
llvm-svn: 275263
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: This patch is adding support to recognize more complex redundant expressions.
Reviewers: alexfh
Subscribers: aaron.ballman, cfe-commits, chrisha
Differential Revision: http://reviews.llvm.org/D21392
llvm-svn: 274731
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Fix PR28350.
Reviewers: alexfh
Subscribers: aaron.ballman, Eugene.Zelenko, cfe-commits
Differential Revision: http://reviews.llvm.org/D21833
llvm-svn: 274496
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: alexfh, aaron.ballman
Subscribers: aaron.ballman, cfe-commits
Differential Revision: http://reviews.llvm.org/D21747
llvm-svn: 273882
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: alexfh
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D21470
llvm-svn: 273849
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: This is a fix for the new ExprWithCleanups introduced by clang's temporary variable lifetime marks change.
Reviewers: bkramer, sbenza, angelgarcia, alexth
Subscribers: rsmith, cfe-commits
Differential Revision: http://reviews.llvm.org/D21243
llvm-svn: 273310
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: alexfh
Subscribers: cfe-commits
Patch by Martin Boehme!
Differential Revision: http://reviews.llvm.org/D21366
llvm-svn: 272897
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
passed as a const ref argument
Summary:
Conceptually, this is very close to the existing functionality of misc-move-const-arg, which is why I'm adding it here and not creating a new check. For example, for a type A that is both movable and copyable, this
const A a1;
A a2(std::move(a1));
is not only a case where a const argument is being passed to std::move(), but the result of std::move() is also being passed as a const reference (due to overload resolution).
The new check typically triggers (exclusively) in cases where people think they're dealing with a movable type, but in fact the type is not movable.
Reviewers: hokein, aaron.ballman, alexfh
Subscribers: aaron.ballman, cfe-commits
Patch by Martin Boehme!
Differential Revision: http://reviews.llvm.org/D21223
llvm-svn: 272896
|
|
|
|
|
|
| |
With minor manual tweaks. No functionality change intended.
llvm-svn: 272795
|
|
|
|
|
|
|
|
| |
macro expansion (e.g. NULL).
Add CHECK-FIX tests.
llvm-svn: 272155
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
declarations
Fixes bugzilla issues 26273 and 27399
Reviewers: alexfh
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D20853
llvm-svn: 272128
|
|
|
|
|
|
| |
const-qualifier is applied to a typedef of pointer type rather than to the pointee type.
llvm-svn: 272025
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: alexfh
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D21059
llvm-svn: 271991
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Make the check's behavior more correct when handling using-decls in multiple scopes.
Reviewers: alexfh
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D20909
llvm-svn: 271632
|
|
|
|
|
|
|
|
|
| |
has matcher changed behaviour, and now it matches "as is" and
doesn't skip implicit and paren casts
http://reviews.llvm.org/D20801
llvm-svn: 271289
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
We should check whether a UsingDecl is defined in macros or in class
definition, not TargetDecls of the UsingDecl.
Reviewers: alexfh
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D20666
llvm-svn: 271199
|
|
|
|
| |
llvm-svn: 270470
|
|
|
|
|
|
|
| |
This should have been done this way from the start, however I somehow missed
r257177.
llvm-svn: 270215
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: alexfh
Subscribers: cfe-commits, djasper
Differential Revision: http://reviews.llvm.org/D20429
llvm-svn: 270191
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: alexfh, aaron.ballman
Subscribers: aaron.ballman, cfe-commits
Differential Revision: http://reviews.llvm.org/D20367
llvm-svn: 269928
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
misc-unused-using-decls check.
Summary: Ignore warning uninstantiated template function usages.
Reviewers: djasper, alexfh
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D20326
llvm-svn: 269906
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This patch is lifting matchers used by more than one checkers
to the common namespace.
Reviewers: aaron.ballman, alexfh
Subscribers: aaron.ballman, cfe-commits
Differential Revision: http://reviews.llvm.org/D19841
llvm-svn: 269804
|
|
|
|
|
|
|
|
|
| |
If a use of a macro argument is preceded by the `namespace` keyword, do
not warn that the use should be wrapped in parentheses.
Patch by Mads Ravn!
llvm-svn: 269786
|
|
|
|
|
|
|
|
|
|
|
|
| |
misc-unused-using-decls checks.
Reviewers: djasper
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D20197
llvm-svn: 269278
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This patch is adding support for conditional expression and overloaded operators.
To decrease false-positive, this patch is adding a list of banned macro names that
has multiple variant with same integer value.
Also fixed support for template instantiation and added an unittest.
Reviewers: alexfh
Subscribers: klimek, Sarcasm, cfe-commits
Differential Revision: http://reviews.llvm.org/D19703
llvm-svn: 269275
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The new API for fixit is in libtooling and the library misc in clang-tidy
didn't had the appropriate dependency.
This commit was breaking some build bots:
http://reviews.llvm.org/D19547
This commit tried (but failed) to fix it:
http://reviews.llvm.org/D20180
To repro, you can make a build with these flags:
```
cmake -DBUILD_SHARED_LIBS=ON
```
Thanks rnk@ for helping figuring out.
Reviewers: alexfh, rnk
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D20182
llvm-svn: 269240
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Refactor some checkers to use the tooling re-writing API.
see: http://reviews.llvm.org/D19941
Reviewers: klimek, alexfh
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D19807
llvm-svn: 269210
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Arguments can be swapped using fixit when they are not in macros.
This is the same implementation than SwappedArguments. Some code
got lifted to be reused.
Others checks are not safe to be fixed as they tend to be bugs or errors.
It is better to let the user manually review them.
Reviewers: alexfh
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D19547
llvm-svn: 269208
|