[PATCH] D72217: [clang-tidy] Added readability-qualified-auto check
Nathan James via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sat Jan 4 19:51:06 PST 2020
njames93 created this revision.
njames93 added a reviewer: aaron.ballman.
njames93 added projects: clang, clang-tools-extra.
Herald added subscribers: xazax.hun, whisperity, mgorny.
njames93 added a comment.
side note when creating this, the add_new_check.py file hasn't been updated in relation to this commit https://github.com/llvm/llvm-project/commit/d2c9c9157b0528436d3b9f5e22c872f0ee6509a2. This results in a malformed rst file. In this patch I have just manually set it up correctly, but a fix will need to be made for the add_new_check.py
Adds a check that detects any auto variables that are deduced to a pointer or a const pointer then adds in the const and asterisk according. Will also check auto L value references that could be written as const. This relates to the coding standard https://llvm.org/docs/CodingStandards.html#beware-unnecessary-copies-with-auto
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D72217
Files:
clang-tools-extra/clang-tidy/readability/CMakeLists.txt
clang-tools-extra/clang-tidy/readability/QualifiedAutoCheck.cpp
clang-tools-extra/clang-tidy/readability/QualifiedAutoCheck.h
clang-tools-extra/clang-tidy/readability/ReadabilityTidyModule.cpp
clang-tools-extra/docs/ReleaseNotes.rst
clang-tools-extra/docs/clang-tidy/checks/list.rst
clang-tools-extra/docs/clang-tidy/checks/readability-qualified-auto.rst
clang-tools-extra/test/clang-tidy/checkers/readability-qualified-auto.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72217.236213.patch
Type: text/x-patch
Size: 14673 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200105/e9b6cf99/attachment-0001.bin>
More information about the cfe-commits
mailing list