| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This change moves tests for checkers and infrastructure into separate
directories, making it easier to find infrastructure tests. Tests for
checkers are already easy to find because they are named after the
checker. Tests for infrastructure were difficult to find because they
were outnumbered by tests for checkers. Now they are in a separate
directory.
Reviewers: jfb, jdoerfert, lebedev.ri
Subscribers: srhines, nemanjai, aheejin, kbarton, christof, mgrang, arphaman, jfb, lebedev.ri, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D68807
llvm-svn: 374540
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
These test cases are illgal in C++2a ("new Foo{}" needs to see the
default constructor), so move them to the C++14-only tests.
Reviewers: gribozavr
Subscribers: xazax.hun, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D62845
llvm-svn: 362679
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Previously, we intended to omit the check fix to the case when constructor has
any braced-init-list argument. But the HasListInitializedArgument was not
correct to handle all cases (Foo(Bar{1, 2}) will return false in C++14
mode).
This patch fixes it, corrects the tests, and makes the check to run at C++17 mode.
Reviewers: gribozavr
Subscribers: xazax.hun, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D62736
llvm-svn: 362361
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
I inspected every test and did one of the following:
- changed the test to run in all language modes,
- added a comment explaining why the test is only applicable in a
certain mode,
- limited the test to language modes where it passes and added a FIXME
to fix the checker or the test.
Reviewers: alexfh, lebedev.ri
Subscribers: nemanjai, kbarton, arphaman, jdoerfert, lebedev.ri, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D62125
llvm-svn: 361131
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The case when initialize_list hides behind an implicit case was not
handled before.
Reviewers: aaron.ballman
Reviewed By: aaron.ballman
Subscribers: xazax.hun, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D61642
llvm-svn: 360231
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: The fix for `auto` new expression is illegal.
Reviewers: aaron.ballman
Subscribers: xazax.hun, cfe-commits
Differential Revision: https://reviews.llvm.org/D54832
llvm-svn: 347551
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
constructor in smart_ptr check.
Summary:
The fix for aggregate initialization (`std::make_unique<Foo>(Foo {1, 2})` needs
to see Foo copy constructor, otherwise we will have a compiler error. So we
only emit the check warning.
Reviewers: JonasToth, aaron.ballman
Subscribers: xazax.hun, cfe-commits
Differential Revision: https://reviews.llvm.org/D54745
llvm-svn: 347537
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
list-initialized arguments
Summary:
Currently the smart_ptr check (modernize-make-unique) generates the
fixes that cannot compile for cases like below -- because brace list can
not be deduced in `make_unique`.
```
struct Bar { int a, b; };
struct Foo { Foo(Bar); };
auto foo = std::unique_ptr<Foo>(new Foo({1, 2}));
```
Reviewers: aaron.ballman
Subscribers: xazax.hun, cfe-commits
Differential Revision: https://reviews.llvm.org/D54704
llvm-svn: 347315
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
side effect.
Summary:
Previously, ptr.reset(new char[5]) will be replaced with `p =
make_unique<char[]>(5)`, the fix has side effect -- doing
default initialization, it may cause performace regression (we are
bitten by this rececntly)
The check should be conservative for these cases.
Reviewers: alexfh
Subscribers: xazax.hun, cfe-commits
Differential Revision: https://reviews.llvm.org/D53377
llvm-svn: 344733
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
make_<smartptr> checks.
Summary:
Extra parentheses around a new expression result in incorrect code
after applying fixes.
Reviewers: hokein
Reviewed By: hokein
Subscribers: xazax.hun, cfe-commits
Differential Revision: https://reviews.llvm.org/D52989
llvm-svn: 344058
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
std::make_unique
Summary: For a c++11 code, the clang-tidy rule "modernize-make-unique" should return immediately, as std::make_unique is not supported.
Reviewers: hokein, aaron.ballman, ilya-biryukov, alexfh
Reviewed By: hokein, aaron.ballman, alexfh
Subscribers: Quuxplusone, xazax.hun, cfe-commits
Tags: #clang-tools-extra
Patch by Frederic Tingaud!
Differential Revision: https://reviews.llvm.org/D43766
llvm-svn: 328101
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Previously, we tried to cover all "std::initializer_list" implicit conversion
cases in the code, but there are some corner cases that not covered (see
newly-added test in the patch).
Sipping all implicit AST nodes is a better way to filter out all these cases.
Reviewers: ilya-biryukov
Subscribers: klimek, xazax.hun, cfe-commits
Differential Revision: https://reviews.llvm.org/D44137
llvm-svn: 326799
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
modernize-make-unique.
Reviewers: ilya-biryukov
Reviewed By: ilya-biryukov
Subscribers: klimek, xazax.hun, cfe-commits
Differential Revision: https://reviews.llvm.org/D42363
llvm-svn: 323191
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
std::initializer_list.
Summary:
A follow-up fix of rL311652.
The previous `vector` in our test is different with `std::vector`, so
The check still generates fixes for std::vector (`auto p =
std::unique_ptr<Foo>(new Foo({1,2,3}))`) in real world, the patch makes the
vector behavior in test align with std::vector (both AST nodes are the same now).
Reviewers: ilya-biryukov, alexfh
Reviewed By: ilya-biryukov
Subscribers: klimek, xazax.hun, cfe-commits
Differential Revision: https://reviews.llvm.org/D41852
llvm-svn: 322822
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
check.
Reviewers: alexfh
Reviewed By: alexfh
Subscribers: JDevlieghere, xazax.hun, cfe-commits
Differential Revision: https://reviews.llvm.org/D37066
llvm-svn: 311652
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: alexfh
Reviewed By: alexfh
Subscribers: JDevlieghere, xazax.hun, cfe-commits
Differential Revision: https://reviews.llvm.org/D36822
llvm-svn: 311086
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
make_unique check.
Summary:
The current fix will break the compilation -- because braced list is not
deducible in std::make_unique (with the use of forwarding) without
specifying the type explicitly.
We could support it in the future.
Reviewers: alexfh
Reviewed By: alexfh
Subscribers: JDevlieghere, xazax.hun, cfe-commits
Differential Revision: https://reviews.llvm.org/D36786
llvm-svn: 311078
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The crash happens when calling `reset` method without any preceding
operation like "->" or ".", this could happen in a subclass of the
"std::unique_ptr".
Reviewers: alexfh
Reviewed By: alexfh
Subscribers: JDevlieghere, xazax.hun, cfe-commits
Differential Revision: https://reviews.llvm.org/D36452
llvm-svn: 310496
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The check doesn't fully support smart-ptr usages inside macros, which
may cause incorrect fixes, or even crashes, ignore them for now.
Reviewers: alexfh
Reviewed By: alexfh
Subscribers: JDevlieghere, xazax.hun, cfe-commits
Differential Revision: https://reviews.llvm.org/D36264
llvm-svn: 310050
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
modernize-make-unique.
Reviewers: alexfh
Reviewed By: alexfh
Subscribers: malcolm.parsons, JDevlieghere, xazax.hun, cfe-commits
Differential Revision: https://reviews.llvm.org/D36016
llvm-svn: 310035
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
modernize-make-shared/unique checks.
Reviewers: alexfh, aaron.ballman
Reviewed By: alexfh
Subscribers: JDevlieghere, Eugene.Zelenko, xazax.hun, cfe-commits
Differential Revision: https://reviews.llvm.org/D34206
llvm-svn: 307130
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: alexfh
Reviewed By: alexfh
Subscribers: JDevlieghere, xazax.hun, cfe-commits
Differential Revision: https://reviews.llvm.org/D34674
llvm-svn: 306421
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
If the class being created in unique_ptr is in anonymous nampespace, the
anonymous namespace will be included in the apply-fixes. This patch fix
this.
```
namespace {
class Foo {};
}
std::unique_ptr<Foo> f;
f.reset(new Foo());
// Before the change: f = std::make_unique<(annonymous namespace)::Foo>();
// After the change: f = std::make_unique<Foo>();
```
Reviewers: alexfh
Reviewed By: alexfh
Subscribers: JDevlieghere, xazax.hun, cfe-commits
Differential Revision: https://reviews.llvm.org/D34286
llvm-svn: 306378
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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:
Bugfix for 27321. When the constructor of stored pointer
type is private then it is invalid to change it to
make_shared or make_unique.
Reviewers: alexfh, aaron.ballman, hokein
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D23343
llvm-svn: 280180
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: "std::unique_ptr<int>" is not the same type as "std::unique_ptr<int, std::default_delete<int>>", unless we insert a "hasCanonicalType" in the middle. Probably it also happens in other cases related to default template argument.
Reviewers: klimek
Subscribers: alexfh, cfe-commits
Differential Revision: http://reviews.llvm.org/D14291
llvm-svn: 252041
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Take into account the current LangOptions the check has to add back the template argument.
Reviewers: klimek
Subscribers: alexfh, cfe-commits
Differential Revision: http://reviews.llvm.org/D13983
llvm-svn: 251013
|
|
|
|
|
|
|
|
|
|
| |
With this, site specific lit configs can inject parameters into the
test scripts if they need site specific parameters.
Next up: enable check_clang_tidy to take a resource dir to enable
non-standard locations for builtin includes.
llvm-svn: 251010
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Use __SIZE_TYPE__ to fix buildbot failures.
Reviewers: klimek
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D13720
llvm-svn: 250288
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: modernize-make-unique now correctly supports the different kinds of list initialization.
Reviewers: klimek
Subscribers: cfe-commits, alexfh
Differential Revision: http://reviews.llvm.org/D13590
llvm-svn: 250283
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Add the second template argument to the unique_ptr mock, and update the matcher so that it only matches against cases where the second argument is the default.
Reviewers: klimek
Subscribers: alexfh, cfe-commits
Differential Revision: http://reviews.llvm.org/D13433
llvm-svn: 249305
|
|
Summary: create a check that replaces 'std::unique_ptr<type>(new type(args...))' with 'std::make_unique<type>(args...)'. It was on the list of "Ideas for new Tools". It needs to be tested more carefully, but first I wanted to know if you think it is worth the effort.
Reviewers: klimek
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D13166
llvm-svn: 248785
|