File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -85,7 +85,7 @@ void LostStdMoveCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) {
85
85
86
86
LostStdMoveCheck::LostStdMoveCheck (StringRef Name, ClangTidyContext *Context)
87
87
: ClangTidyCheck(Name, Context),
88
- StrictMode (Options.get(" StrictMode" , true )) {}
88
+ StrictMode (Options.get(" StrictMode" , false )) {}
89
89
90
90
void LostStdMoveCheck::registerMatchers (MatchFinder *Finder) {
91
91
auto ReturnParent =
@@ -132,7 +132,7 @@ void LostStdMoveCheck::check(const MatchFinder::MatchResult &Result) {
132
132
return ;
133
133
}
134
134
135
- if (StrictMode) {
135
+ if (! StrictMode) {
136
136
llvm::SmallPtrSet<const VarDecl *, 16 > AllVarDecls =
137
137
allVarDeclsExprs (*MatchedDecl, *MatchedFunc, *Result.Context );
138
138
if (!AllVarDecls.empty ()) {
Original file line number Diff line number Diff line change @@ -27,11 +27,11 @@ Also it does notice variable references "behind the scenes":
27
27
void g(X x) {
28
28
auto &y = x;
29
29
f(x); // does not emit a warning
30
- y.f(); // because is still used
30
+ y.f(); // because x is still used via y
31
31
}
32
32
33
33
If you want to ignore assigns to reference variables, set ::option::
34
- `StrictMode ` to `false `.
34
+ `StrictMode ` to `true `.
35
35
36
36
37
37
Options
@@ -45,4 +45,4 @@ Options
45
45
references ``X ``, then it will not emit a warning for ``X `` not to provoke
46
46
false positive. If you're sure that such references don't extend ``X ``
47
47
lifetime and ready to handle possible false positives, then set `StrictMode `
48
- to `false `. Defaults to `true `.
48
+ to `true `. Defaults to `false `.
Original file line number Diff line number Diff line change 1
- // RUN: %check_clang_tidy %s performance-lost-std-move %t -- -config='{CheckOptions: {performance-lost-std-move.StrictMode: false }}'
1
+ // RUN: %check_clang_tidy %s performance-lost-std-move %t -- -config='{CheckOptions: {performance-lost-std-move.StrictMode: true }}'
2
2
3
3
namespace std {
4
4
You can’t perform that action at this time.
0 commit comments