Skip to content

Commit 165bce4

Browse files
committed
add test with different const placement
1 parent b46ca21 commit 165bce4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,12 @@ void ParameterPack(Args... args) {
103103
// CHECK-FIXES: void ParameterPack(const Args&... args) {
104104
}
105105

106+
template <typename... Args>
107+
void ParameterPackConst(Args const... args) {
108+
// CHECK-MESSAGES: [[@LINE-1]]:39: warning: the const qualified parameter 'args' of type 'const ExpensiveToCopyType'
109+
// CHECK-FIXES: void ParameterPackConst(Args const&... args) {
110+
}
111+
106112
template <typename... Args>
107113
void ParameterPackWithParams(const ExpensiveToCopyType E1, ExpensiveToCopyType E2, Args... args) {
108114
// CHECK-MESSAGES: [[@LINE-1]]:56: warning: the const qualified parameter 'E1'
@@ -117,6 +123,7 @@ void PackWithNonExpensive(int x, Args... args) {}
117123
void instantiatedParameterPack() {
118124
ExpensiveToCopyType E;
119125
ParameterPack(E);
126+
ParameterPackConst(E);
120127
ParameterPackWithParams(E, E, E);
121128
PackWithNonExpensive(5, 5);
122129
}

0 commit comments

Comments
 (0)