Skip to content

Commit 1af04f7

Browse files
committed
merge main into amd-staging
2 parents 0932ec8 + 34c2ea3 commit 1af04f7

File tree

73 files changed

+834
-306
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+834
-306
lines changed

.github/workflows/libc-fullbuild-tests.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,36 +20,30 @@ jobs:
2020
include:
2121
- os: ubuntu-24.04
2222
build_type: Debug
23-
ccache-variant: sccache
2423
c_compiler: clang-22
2524
cpp_compiler: clang++-22
2625
target: x86_64-unknown-linux-llvm
2726
include_scudo: ON
2827
- os: ubuntu-24.04
2928
build_type: Release
30-
ccache-variant: sccache
3129
c_compiler: clang-22
3230
cpp_compiler: clang++-22
3331
target: x86_64-unknown-linux-llvm
3432
include_scudo: ON
3533
- os: ubuntu-24.04
3634
build_type: MinSizeRel
37-
ccache-variant: sccache
3835
c_compiler: clang-22
3936
cpp_compiler: clang++-22
4037
target: x86_64-unknown-linux-llvm
4138
include_scudo: ON
42-
# TODO: remove ccache logic when https://github.com/hendrikmuhs/ccache-action/issues/279 is resolved.
4339
- os: ubuntu-24.04-arm
4440
build_type: Debug
45-
ccache-variant: ccache
4641
c_compiler: clang-22
4742
cpp_compiler: clang++-22
4843
target: aarch64-unknown-linux-llvm
4944
include_scudo: ON
5045
- os: ubuntu-24.04
5146
build_type: Debug
52-
ccache-variant: ccache
5347
c_compiler: clang-22
5448
cpp_compiler: clang++-22
5549
target: x86_64-unknown-uefi-llvm
@@ -71,7 +65,7 @@ jobs:
7165
with:
7266
max-size: 1G
7367
key: libc_fullbuild_${{ matrix.c_compiler }}
74-
variant: ${{ matrix.ccache-variant }}
68+
variant: sccache
7569

7670
# Notice:
7771
# - MPFR is required by some of the mathlib tests.
@@ -112,8 +106,8 @@ jobs:
112106
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} \
113107
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }} \
114108
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
115-
-DCMAKE_C_COMPILER_LAUNCHER=${{ matrix.ccache-variant }} \
116-
-DCMAKE_CXX_COMPILER_LAUNCHER=${{ matrix.ccache-variant }} \
109+
-DCMAKE_C_COMPILER_LAUNCHER=sccache \
110+
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache \
117111
-DCMAKE_INSTALL_PREFIX=${{ steps.strings.outputs.build-install-dir }} \
118112
-DLLVM_RUNTIME_TARGETS=${{ matrix.target }} \
119113
-DLLVM_ENABLE_RUNTIMES="$RUNTIMES" \

.github/workflows/libc-overlay-tests.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,28 +20,22 @@ jobs:
2020
include:
2121
# TODO: add linux gcc when it is fixed
2222
- os: ubuntu-24.04
23-
ccache-variant: sccache
2423
compiler:
2524
c_compiler: clang
2625
cpp_compiler: clang++
27-
# TODO: remove ccache logic when https://github.com/hendrikmuhs/ccache-action/issues/279 is resolved.
2826
- os: ubuntu-24.04-arm
29-
ccache-variant: ccache
3027
compiler:
3128
c_compiler: clang
3229
cpp_compiler: clang++
3330
- os: windows-2022
34-
ccache-variant: sccache
3531
compiler:
3632
c_compiler: clang-cl
3733
cpp_compiler: clang-cl
3834
- os: windows-2025
39-
ccache-variant: sccache
4035
compiler:
4136
c_compiler: clang-cl
4237
cpp_compiler: clang-cl
4338
- os: macos-14
44-
ccache-variant: sccache
4539
compiler:
4640
c_compiler: clang
4741
cpp_compiler: clang++
@@ -61,7 +55,7 @@ jobs:
6155
with:
6256
max-size: 1G
6357
key: libc_overlay_build_${{ matrix.os }}_${{ matrix.compiler.c_compiler }}
64-
variant: ${{ matrix.ccache-variant }}
58+
variant: sccache
6559

6660
# MPFR is required by some of the mathlib tests.
6761
- name: Prepare dependencies (Ubuntu)
@@ -97,8 +91,8 @@ jobs:
9791
-DCMAKE_CXX_COMPILER=${{ matrix.compiler.cpp_compiler }}
9892
-DCMAKE_C_COMPILER=${{ matrix.compiler.c_compiler }}
9993
-DCMAKE_BUILD_TYPE=Debug
100-
-DCMAKE_C_COMPILER_LAUNCHER=${{ matrix.ccache-variant }}
101-
-DCMAKE_CXX_COMPILER_LAUNCHER=${{ matrix.ccache-variant }}
94+
-DCMAKE_C_COMPILER_LAUNCHER=sccache
95+
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache
10296
-DCMAKE_POLICY_DEFAULT_CMP0141=NEW
10397
-DCMAKE_MSVC_DEBUG_INFORMATION_FORMAT=Embedded
10498
-DLLVM_ENABLE_RUNTIMES=libc

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);

0 commit comments

Comments
 (0)