This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Let misc-const-correctness detect auto local variables that can be made const
Needs RevisionPublic

Authored by ChrisThrasher on Mar 11 2023, 6:15 PM.

Diff Detail

Event Timeline

ChrisThrasher created this revision.Mar 11 2023, 6:15 PM
ChrisThrasher requested review of this revision.Mar 11 2023, 6:15 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 11 2023, 6:15 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
PiotrZSL requested changes to this revision.Mar 12 2023, 12:21 AM
  • Failed tests
  • Missing tests for this change
  • Missing configuration option for this change (changing default behavior)
  • Missing release notes
  • Missing documentation update
  • auto& , auto&&, auto* still wont be ignored (that's also auto type).
This revision now requires changes to proceed.Mar 12 2023, 12:21 AM

I'm working on the test failures and improved test coverage. Where can I learn more about how to update the release notes and documentation?

Tests:
./clang-tools-extra/test/clang-tidy/checkers/misc/const-correctness-transform-values.cpp
./clang-tools-extra/test/clang-tidy/checkers/misc/const-correctness-cxx17.cpp
./clang-tools-extra/test/clang-tidy/checkers/misc/const-correctness-templates.cpp
./clang-tools-extra/test/clang-tidy/checkers/misc/const-correctness-transform-pointer-as-values.cpp
./clang-tools-extra/test/clang-tidy/checkers/misc/const-correctness-unaligned.cpp
./clang-tools-extra/test/clang-tidy/checkers/misc/const-correctness-pointer-as-values.cpp
./clang-tools-extra/test/clang-tidy/checkers/misc/const-correctness-values.cpp
./clang-tools-extra/test/clang-tidy/checkers/misc/const-correctness-wrong-config.cpp

Documentation:
./clang-tools-extra/docs/clang-tidy/checks/misc/const-correctness.rst

Release notes:
./clang-tools-extra/docs/ReleaseNotes.rst

For things like options, look how other checks do that.

cjdb added a subscriber: cjdb.Mar 13 2023, 10:12 AM

Would you be able to update the commit message to include a description that explains why this commit is necessary please?