You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
unused-local-non-trivial-variable
Also add the ability to match against template specializations, this can
be useful if you want all std::future types to be matched, no matter
what type is held within the future.
Signed-off-by: Tyler Rockwood <[email protected]>
Copy file name to clipboardExpand all lines: clang-tools-extra/test/clang-tidy/checkers/bugprone/unused-local-non-trivial-variable.cpp
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -73,6 +73,10 @@ T qux(T Generic) {
73
73
async::Future<Units> MustBeUsed;
74
74
// CHECK-MESSAGES: :[[@LINE-1]]:26: warning: unused local variable 'MustBeUsed' of type 'async::Future<Units>' [bugprone-unused-local-non-trivial-variable]
75
75
PendingA.get();
76
+
async::Future<T> TemplateType;
77
+
// CHECK-MESSAGES: :[[@LINE-1]]:22: warning: unused local variable 'TemplateType' of type 'async::Future<T>' [bugprone-unused-local-non-trivial-variable]
78
+
a::Future<T> AliasTemplateType;
79
+
// CHECK-MESSAGES: :[[@LINE-1]]:18: warning: unused local variable 'AliasTemplateType' of type 'a::Future<T>' (aka 'Future<type-parameter-0-0>') [bugprone-unused-local-non-trivial-variable]
0 commit comments