CLion (2023.1.2) is running clang-tidy v17 on a project of mine. It's complaining about me passing an std::experimental::optional (from C++14) by value instead of by reference. That seems egregious to me... how can I increase the "object weight threshold" for eliciting clang-tidy complaints about copying?
The exact problem description:
Clang-Tidy: The parameter 'whatever' is copied for each invocation but only used as a const reference; consider making it a const reference
Note: Unlike in this question, I want to change clang-tidy's threshold, not whitelist a specific line of code or specific type.
sizeof(std::optional<unsigned>)is8on my machine.nullopt, and a size of 5 or 6 would be weird and problematic performance-wise.std::experimental::optionalin both C++14 and C++20 mode, while usingstd::optionalin C++20 does not give that complaint.clang-tidy/performance/UnnecessaryValueParamCheck.cppbtw