-
Notifications
You must be signed in to change notification settings - Fork 12.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[clang-tidy] Add AllowedTypes option to misc-const-correctness #122592
Comments
@llvm/issue-subscribers-clang-tidy Author: Baranov Victor (vbvictor)
Sometimes in large codebases we want to ignore const-correctness of certain classes because they are immutable by nature, so there is no point in adding const to them.
Minimal example:
#include <mutex>
int main() {
std::mutex m;
std::lock_guard<std::mutex> l(m); // check is triggered but we want to ignore it since lock_guard is already immutable.
} Writing NOLINT for thousands of places bloats code and is not an appealing option. |
Can this issue be assigned to me if it is a good improvement |
There is #58084 which is somewhat related by adding an option to only report it for POD types. |
This option may help with my particular case with |
See all my notes in the other ticket what the actual intention is. The title is a bit misleading. |
Sometimes in large codebases we want to ignore const-correctness of certain classes because they are immutable by nature, so there is no point in adding const to them.
Minimal example:
Writing NOLINT for thousands of places bloats code and is not an appealing option.
The text was updated successfully, but these errors were encountered: