Skip to content

Commit 940f37a

Browse files
carlosgalvezpCarlos Gálvez
andauthored
[clang-tidy] Print type information to performance-unnecessary-* checks (#152101)
Useful when the check warns on template functions to know which type it's complaining about. Otherwise, since the instantiation stack is not printed, it's very hard to tell. Co-authored-by: Carlos Gálvez <[email protected]>
1 parent be4a739 commit 940f37a

11 files changed

+70
-58
lines changed

clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitialization.cpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -349,23 +349,25 @@ void UnnecessaryCopyInitialization::diagnoseCopyFromMethodReturn(
349349
const CheckContext &Ctx) {
350350
auto Diagnostic =
351351
diag(Ctx.Var.getLocation(),
352-
"the %select{|const qualified }0variable %1 is "
352+
"the %select{|const qualified }0variable %1 of type %2 is "
353353
"copy-constructed "
354354
"from a const reference%select{%select{ but is only used as const "
355-
"reference|}0| but is never used}2; consider "
356-
"%select{making it a const reference|removing the statement}2")
357-
<< Ctx.Var.getType().isConstQualified() << &Ctx.Var << Ctx.IsVarUnused;
355+
"reference|}0| but is never used}3; consider "
356+
"%select{making it a const reference|removing the statement}3")
357+
<< Ctx.Var.getType().isConstQualified() << &Ctx.Var << Ctx.Var.getType()
358+
<< Ctx.IsVarUnused;
358359
maybeIssueFixes(Ctx, Diagnostic);
359360
}
360361

361362
void UnnecessaryCopyInitialization::diagnoseCopyFromLocalVar(
362363
const CheckContext &Ctx, const VarDecl &OldVar) {
363364
auto Diagnostic =
364365
diag(Ctx.Var.getLocation(),
365-
"local copy %1 of the variable %0 is never modified%select{"
366-
"| and never used}2; consider %select{avoiding the copy|removing "
367-
"the statement}2")
368-
<< &OldVar << &Ctx.Var << Ctx.IsVarUnused;
366+
"local copy %0 of the variable %1 of type %2 is never "
367+
"modified%select{"
368+
"| and never used}3; consider %select{avoiding the copy|removing "
369+
"the statement}3")
370+
<< &Ctx.Var << &OldVar << Ctx.Var.getType() << Ctx.IsVarUnused;
369371
maybeIssueFixes(Ctx, Diagnostic);
370372
}
371373

clang-tools-extra/clang-tidy/performance/UnnecessaryValueParamCheck.cpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,12 @@ void UnnecessaryValueParamCheck::handleConstRefFix(const FunctionDecl &Function,
143143

144144
auto Diag =
145145
diag(Param.getLocation(),
146-
"the %select{|const qualified }0parameter %1 is copied for each "
146+
"the %select{|const qualified }0parameter %1 of type %2 is copied "
147+
"for each "
147148
"invocation%select{ but only used as a const reference|}0; consider "
148149
"making it a %select{const |}0reference")
149-
<< IsConstQualified << paramNameOrIndex(Param.getName(), Index);
150+
<< IsConstQualified << paramNameOrIndex(Param.getName(), Index)
151+
<< Param.getType();
150152
// Do not propose fixes when:
151153
// 1. the ParmVarDecl is in a macro, since we cannot place them correctly
152154
// 2. the function is virtual as it might break overrides
@@ -173,10 +175,11 @@ void UnnecessaryValueParamCheck::handleConstRefFix(const FunctionDecl &Function,
173175
void UnnecessaryValueParamCheck::handleMoveFix(const ParmVarDecl &Param,
174176
const DeclRefExpr &CopyArgument,
175177
ASTContext &Context) {
176-
auto Diag = diag(CopyArgument.getBeginLoc(),
177-
"parameter %0 is passed by value and only copied once; "
178-
"consider moving it to avoid unnecessary copies")
179-
<< &Param;
178+
auto Diag =
179+
diag(CopyArgument.getBeginLoc(),
180+
"parameter %0 of type %1 is passed by value and only copied once; "
181+
"consider moving it to avoid unnecessary copies")
182+
<< &Param << Param.getType();
180183
// Do not propose fixes in macros since we cannot place them correctly.
181184
if (CopyArgument.getBeginLoc().isMacroID())
182185
return;

clang-tools-extra/docs/ReleaseNotes.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,14 @@ Changes in existing checks
170170
when the format string is converted to a different type by an implicit
171171
constructor call.
172172

173+
- Improved :doc:`performance-unnecessary-copy-initialization
174+
<clang-tidy/checks/performance/unnecessary-copy-initialization>` by printing
175+
the type of the diagnosed variable.
176+
177+
- Improved :doc:`performance-unnecessary-value-param
178+
<clang-tidy/checks/performance/unnecessary-value-param>` by printing
179+
the type of the diagnosed variable.
180+
173181
- Improved :doc:`portability-template-virtual-member-function
174182
<clang-tidy/checks/portability/template-virtual-member-function>` check to
175183
avoid false positives on pure virtual member functions.

clang-tools-extra/test/clang-tidy/checkers/performance/unnecessary-copy-initialization-allowed-types.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ void negative_smart_ref() {
8888

8989
void positiveOtherType() {
9090
const auto O = getOtherType();
91-
// CHECK-MESSAGES: [[@LINE-1]]:14: warning: the const qualified variable 'O' is copy-constructed from a const reference; consider making it a const reference [performance-unnecessary-copy-initialization]
91+
// CHECK-MESSAGES: [[@LINE-1]]:14: warning: the const qualified variable 'O' of type 'const OtherType' is copy-constructed from a const reference; consider making it a const reference [performance-unnecessary-copy-initialization]
9292
// CHECK-FIXES: const auto& O = getOtherType();
9393
O.constMethod();
9494
}

clang-tools-extra/test/clang-tidy/checkers/performance/unnecessary-copy-initialization-excluded-container-types.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ void positiveViewType() {
3131
ExpensiveToCopy E;
3232
ViewType<ExpensiveToCopy> V(E);
3333
const auto O = V.view();
34-
// CHECK-MESSAGES: [[@LINE-1]]:14: warning: the const qualified variable 'O' is copy-constructed
34+
// CHECK-MESSAGES: [[@LINE-1]]:14: warning: the const qualified variable 'O' of type 'ExpensiveToCopy const' is copy-constructed
3535
// CHECK-FIXES: const auto& O = V.view();
3636
O.constMethod();
3737
}

clang-tools-extra/test/clang-tidy/checkers/performance/unnecessary-copy-initialization.cpp

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ void useByValue(ExpensiveToCopyType);
8282

8383
void PositiveFunctionCall() {
8484
const auto AutoAssigned = ExpensiveTypeReference();
85-
// CHECK-MESSAGES: [[@LINE-1]]:14: warning: the const qualified variable 'AutoAssigned' is copy-constructed from a const reference; consider making it a const reference [performance-unnecessary-copy-initialization]
85+
// CHECK-MESSAGES: [[@LINE-1]]:14: warning: the const qualified variable 'AutoAssigned' of type 'const ExpensiveToCopyType' is copy-constructed from a const reference; consider making it a const reference [performance-unnecessary-copy-initialization]
8686
// CHECK-FIXES: const auto& AutoAssigned = ExpensiveTypeReference();
8787
AutoAssigned.constMethod();
8888

@@ -104,7 +104,7 @@ void PositiveFunctionCall() {
104104

105105
void PositiveStaticMethodCall() {
106106
const auto AutoAssigned = ExpensiveToCopyType::instance();
107-
// CHECK-MESSAGES: [[@LINE-1]]:14: warning: the const qualified variable 'AutoAssigned' is copy-constructed from a const reference; consider making it a const reference [performance-unnecessary-copy-initialization]
107+
// CHECK-MESSAGES: [[@LINE-1]]:14: warning: the const qualified variable 'AutoAssigned' of type 'const ExpensiveToCopyType' is copy-constructed from a const reference; consider making it a const reference [performance-unnecessary-copy-initialization]
108108
// CHECK-FIXES: const auto& AutoAssigned = ExpensiveToCopyType::instance();
109109
AutoAssigned.constMethod();
110110

@@ -339,7 +339,7 @@ void NegativeStaticLocalVar(const ExpensiveToCopyType &Obj) {
339339

340340
void PositiveFunctionCallExpensiveTypeNonConstVariable() {
341341
auto AutoAssigned = ExpensiveTypeReference();
342-
// CHECK-MESSAGES: [[@LINE-1]]:8: warning: the variable 'AutoAssigned' is copy-constructed from a const reference but is only used as const reference; consider making it a const reference [performance-unnecessary-copy-initialization]
342+
// CHECK-MESSAGES: [[@LINE-1]]:8: warning: the variable 'AutoAssigned' of type 'ExpensiveToCopyType' is copy-constructed from a const reference but is only used as const reference; consider making it a const reference [performance-unnecessary-copy-initialization]
343343
// CHECK-FIXES: const auto& AutoAssigned = ExpensiveTypeReference();
344344
AutoAssigned.constMethod();
345345

@@ -472,13 +472,13 @@ struct NegativeConstructor {
472472
// CHECK-FIXES: auto AssignedInMacro = T.reference();
473473

474474
UNNECESSARY_COPY_INIT_IN_MACRO_BODY(ExpensiveToCopyType)
475-
// CHECK-MESSAGES: [[@LINE-1]]:1: warning: the variable 'AssignedInMacro' is copy-constructed
475+
// CHECK-MESSAGES: [[@LINE-1]]:1: warning: the variable 'AssignedInMacro' of type 'ExpensiveToCopyType' is copy-constructed
476476

477477
#define UNNECESSARY_COPY_INIT_IN_MACRO_ARGUMENT(ARGUMENT) ARGUMENT
478478

479479
void PositiveMacroArgument(const ExpensiveToCopyType &Obj) {
480480
UNNECESSARY_COPY_INIT_IN_MACRO_ARGUMENT(auto CopyInMacroArg = Obj.reference());
481-
// CHECK-MESSAGES: [[@LINE-1]]:48: warning: the variable 'CopyInMacroArg' is copy-constructed
481+
// CHECK-MESSAGES: [[@LINE-1]]:48: warning: the variable 'CopyInMacroArg' of type 'ExpensiveToCopyType' is copy-constructed
482482
// Ensure fix is not applied.
483483
// CHECK-FIXES: auto CopyInMacroArg = Obj.reference()
484484
CopyInMacroArg.constMethod();
@@ -487,7 +487,7 @@ void PositiveMacroArgument(const ExpensiveToCopyType &Obj) {
487487
void PositiveLocalCopyConstMethodInvoked() {
488488
ExpensiveToCopyType orig;
489489
ExpensiveToCopyType copy_1 = orig;
490-
// CHECK-MESSAGES: [[@LINE-1]]:23: warning: local copy 'copy_1' of the variable 'orig' is never modified; consider avoiding the copy [performance-unnecessary-copy-initialization]
490+
// CHECK-MESSAGES: [[@LINE-1]]:23: warning: local copy 'copy_1' of the variable 'orig' of type 'ExpensiveToCopyType' is never modified; consider avoiding the copy [performance-unnecessary-copy-initialization]
491491
// CHECK-FIXES: const ExpensiveToCopyType& copy_1 = orig;
492492
copy_1.constMethod();
493493
orig.constMethod();
@@ -599,7 +599,7 @@ void NegativeLocalCopyWeirdNonCopy() {
599599
void WarningOnlyMultiDeclStmt() {
600600
ExpensiveToCopyType orig;
601601
ExpensiveToCopyType copy = orig, copy2;
602-
// CHECK-MESSAGES: [[@LINE-1]]:23: warning: local copy 'copy' of the variable 'orig' is never modified; consider avoiding the copy [performance-unnecessary-copy-initialization]
602+
// CHECK-MESSAGES: [[@LINE-1]]:23: warning: local copy 'copy' of the variable 'orig' of type 'ExpensiveToCopyType' is never modified; consider avoiding the copy [performance-unnecessary-copy-initialization]
603603
// CHECK-FIXES: ExpensiveToCopyType copy = orig, copy2;
604604
copy.constMethod();
605605
}
@@ -676,7 +676,7 @@ struct function {
676676

677677
void positiveFakeStdFunction(std::function<void(int)> F) {
678678
auto Copy = F;
679-
// CHECK-MESSAGES: [[@LINE-1]]:8: warning: local copy 'Copy' of the variable 'F' is never modified;
679+
// CHECK-MESSAGES: [[@LINE-1]]:8: warning: local copy 'Copy' of the variable 'F' of type 'std::function<void (int)>' is never modified;
680680
// CHECK-FIXES: const auto& Copy = F;
681681
Copy.constMethod();
682682
}
@@ -687,7 +687,7 @@ void positiveInvokedOnStdFunction(
687687
std::function<void(const ExpensiveToCopyType &)> Update,
688688
const ExpensiveToCopyType Orig) {
689689
auto Copy = Orig.reference();
690-
// CHECK-MESSAGES: [[@LINE-1]]:8: warning: the variable 'Copy' is copy-constructed from a const reference
690+
// CHECK-MESSAGES: [[@LINE-1]]:8: warning: the variable 'Copy' of type 'ExpensiveToCopyType' is copy-constructed from a const reference
691691
// CHECK-FIXES: const auto& Copy = Orig.reference();
692692
Update(Copy);
693693
}
@@ -746,7 +746,7 @@ void positiveCopiedFromGetterOfReferenceToConstVar() {
746746
ExpensiveToCopyType Orig;
747747
const auto &Ref = Orig.reference();
748748
auto UnnecessaryCopy = Ref.reference();
749-
// CHECK-MESSAGES: [[@LINE-1]]:8: warning: the variable 'UnnecessaryCopy' is
749+
// CHECK-MESSAGES: [[@LINE-1]]:8: warning: the variable 'UnnecessaryCopy' of type 'ExpensiveToCopyType' is
750750
// CHECK-FIXES: const auto& UnnecessaryCopy = Ref.reference();
751751
Orig.constMethod();
752752
UnnecessaryCopy.constMethod();
@@ -755,18 +755,18 @@ void positiveCopiedFromGetterOfReferenceToConstVar() {
755755
void positiveUnusedReferenceIsRemoved() {
756756
// clang-format off
757757
const auto AutoAssigned = ExpensiveTypeReference(); int i = 0; // Foo bar.
758-
// CHECK-MESSAGES: [[@LINE-1]]:14: warning: the const qualified variable 'AutoAssigned' is copy-constructed from a const reference but is never used; consider removing the statement [performance-unnecessary-copy-initialization]
758+
// CHECK-MESSAGES: [[@LINE-1]]:14: warning: the const qualified variable 'AutoAssigned' of type 'const ExpensiveToCopyType' is copy-constructed from a const reference but is never used; consider removing the statement [performance-unnecessary-copy-initialization]
759759
// CHECK-FIXES-NOT: const auto AutoAssigned = ExpensiveTypeReference();
760760
// CHECK-FIXES: int i = 0; // Foo bar.
761761
auto TrailingCommentRemoved = ExpensiveTypeReference(); // Trailing comment.
762-
// CHECK-MESSAGES: [[@LINE-1]]:8: warning: the variable 'TrailingCommentRemoved' is copy-constructed from a const reference but is never used;
762+
// CHECK-MESSAGES: [[@LINE-1]]:8: warning: the variable 'TrailingCommentRemoved' of type 'ExpensiveToCopyType' is copy-constructed from a const reference but is never used;
763763
// CHECK-FIXES-NOT: auto TrailingCommentRemoved = ExpensiveTypeReference();
764764
// CHECK-FIXES-NOT: // Trailing comment.
765765
// clang-format on
766766

767767
auto UnusedAndUnnecessary = ExpensiveTypeReference();
768768
// Comments on a new line should not be deleted.
769-
// CHECK-MESSAGES: [[@LINE-2]]:8: warning: the variable 'UnusedAndUnnecessary' is copy-constructed
769+
// CHECK-MESSAGES: [[@LINE-2]]:8: warning: the variable 'UnusedAndUnnecessary' of type 'ExpensiveToCopyType' is copy-constructed
770770
// CHECK-FIXES-NOT: auto UnusedAndUnnecessary = ExpensiveTypeReference();
771771
// CHECK-FIXES: // Comments on a new line should not be deleted.
772772
}
@@ -865,7 +865,7 @@ void negativeTemplateTypes() {
865865

866866
// Non-dependent types in template still trigger the check.
867867
const auto UnnecessaryCopy = ExpensiveTypeReference();
868-
// CHECK-MESSAGES: [[@LINE-1]]:14: warning: the const qualified variable 'UnnecessaryCopy' is copy-constructed
868+
// CHECK-MESSAGES: [[@LINE-1]]:14: warning: the const qualified variable 'UnnecessaryCopy' of type 'const ExpensiveToCopyType' is copy-constructed
869869
// CHECK-FIXES: const auto& UnnecessaryCopy = ExpensiveTypeReference();
870870
UnnecessaryCopy.constMethod();
871871
}
@@ -880,17 +880,17 @@ template <typename A>
880880
void positiveSingleTemplateType() {
881881
A Orig;
882882
A SingleTmplParmTypeCopy = Orig;
883-
// CHECK-MESSAGES: [[@LINE-1]]:5: warning: local copy 'SingleTmplParmTypeCopy' of the variable 'Orig' is never modified
883+
// CHECK-MESSAGES: [[@LINE-1]]:5: warning: local copy 'SingleTmplParmTypeCopy' of the variable 'Orig' of type 'ExpensiveToCopyType' is never modified
884884
// CHECK-FIXES: const A& SingleTmplParmTypeCopy = Orig;
885885
SingleTmplParmTypeCopy.constMethod();
886886

887887
A UnnecessaryCopy2 = templatedReference<A>();
888-
// CHECK-MESSAGES: [[@LINE-1]]:5: warning: the variable 'UnnecessaryCopy2' is copy-constructed from a const reference
888+
// CHECK-MESSAGES: [[@LINE-1]]:5: warning: the variable 'UnnecessaryCopy2' of type 'ExpensiveToCopyType' is copy-constructed from a const reference
889889
// CHECK-FIXES: const A& UnnecessaryCopy2 = templatedReference<A>();
890890
UnnecessaryCopy2.constMethod();
891891

892892
A UnnecessaryCopy3 = Orig.template templatedAccessor<A>();
893-
// CHECK-MESSAGES: [[@LINE-1]]:5: warning: the variable 'UnnecessaryCopy3' is copy-constructed from a const reference
893+
// CHECK-MESSAGES: [[@LINE-1]]:5: warning: the variable 'UnnecessaryCopy3' of type 'ExpensiveToCopyType' is copy-constructed from a const reference
894894
// CHECK-FIXES: const A& UnnecessaryCopy3 = Orig.template templatedAccessor<A>();
895895
UnnecessaryCopy3.constMethod();
896896
}
@@ -938,4 +938,3 @@ template<typename T> bool OperatorWithNoDirectCallee(T t) {
938938
ExpensiveToCopyType a2 = a1;
939939
return a1 == t;
940940
}
941-

clang-tools-extra/test/clang-tidy/checkers/performance/unnecessary-value-param-allowed-types.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ void negative_smart_ref(smart_ref r) {
6767
}
6868

6969
void positiveOtherType(OtherType O) {
70-
// CHECK-MESSAGES: [[@LINE-1]]:34: warning: the parameter 'O' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
70+
// CHECK-MESSAGES: [[@LINE-1]]:34: warning: the parameter 'O' of type 'OtherType' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
7171
// CHECK-FIXES: void positiveOtherType(const OtherType& O) {
7272
}
7373

clang-tools-extra/test/clang-tidy/checkers/performance/unnecessary-value-param-crash.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ struct C
1717
{
1818
A a;
1919
C(B, int i) : a(i) {}
20-
// CHECK-MESSAGES: [[@LINE-1]]:6: warning: the parameter #1 is copied for each invocation but only used as a const reference; consider making it a const reference
20+
// CHECK-MESSAGES: [[@LINE-1]]:6: warning: the parameter #1 of type 'B' is copied for each invocation but only used as a const reference; consider making it a const reference
2121
};
2222

2323
C c(B(), 0);

clang-tools-extra/test/clang-tidy/checkers/performance/unnecessary-value-param-delayed.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ class SomewhatTrivial {
2626
void positiveExpensiveConstValue(const ExpensiveToCopyType Obj);
2727
// CHECK-FIXES: void positiveExpensiveConstValue(const ExpensiveToCopyType& Obj);
2828
void positiveExpensiveConstValue(const ExpensiveToCopyType Obj) {
29-
// CHECK-MESSAGES: [[@LINE-1]]:60: warning: the const qualified parameter 'Obj' is copied for each invocation; consider making it a reference [performance-unnecessary-value-param]
29+
// CHECK-MESSAGES: [[@LINE-1]]:60: warning: the const qualified parameter 'Obj' of type 'const ExpensiveToCopyType' is copied for each invocation; consider making it a reference [performance-unnecessary-value-param]
3030
// CHECK-FIXES: void positiveExpensiveConstValue(const ExpensiveToCopyType& Obj) {
3131
}
3232

3333
void positiveExpensiveValue(ExpensiveToCopyType Obj);
3434
// CHECK-FIXES: void positiveExpensiveValue(const ExpensiveToCopyType& Obj);
3535
void positiveExpensiveValue(ExpensiveToCopyType Obj) {
36-
// CHECK-MESSAGES: [[@LINE-1]]:49: warning: the parameter 'Obj' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
36+
// CHECK-MESSAGES: [[@LINE-1]]:49: warning: the parameter 'Obj' of type 'ExpensiveToCopyType' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
3737
// CHECK-FIXES: void positiveExpensiveValue(const ExpensiveToCopyType& Obj) {
3838
Obj.constReference();
3939
useAsConstReference(Obj);

clang-tools-extra/test/clang-tidy/checkers/performance/unnecessary-value-param-header.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99

1010

1111
int f1(int n, ABC v1, ABC v2) {
12-
// CHECK-MESSAGES: [[@LINE-1]]:19: warning: the parameter 'v1' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
13-
// CHECK-MESSAGES: [[@LINE-2]]:27: warning: the parameter 'v2' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
12+
// CHECK-MESSAGES: [[@LINE-1]]:19: warning: the parameter 'v1' of type 'ABC' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
13+
// CHECK-MESSAGES: [[@LINE-2]]:27: warning: the parameter 'v2' of type 'ABC' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
1414
// CHECK-FIXES: int f1(int n, const ABC& v1, const ABC& v2) {
1515
return v1.get(n) + v2.get(n);
1616
}
1717
void f2(int n, ABC v2) {
18-
// CHECK-MESSAGES: [[@LINE-1]]:20: warning: the parameter 'v2' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
18+
// CHECK-MESSAGES: [[@LINE-1]]:20: warning: the parameter 'v2' of type 'ABC' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
1919
// CHECK-FIXES: void f2(int n, const ABC& v2) {
2020
}

0 commit comments

Comments
 (0)