24 lines · cpp
1// RUN: %check_clang_tidy -std=c++14-or-later %s performance-unnecessary-value-param %t2 3// The test case used to crash clang-tidy.4// https://github.com/llvm/llvm-project/issues/1089635 6struct A7{8 template<typename T> A(T&&) {}9};10 11struct B12{13 ~B();14};15 16struct C17{18 A a;19 C(B, int i) : a(i) {}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 reference21};22 23C c(B(), 0);24