[PATCH] D54395: [clang-tidy] implement utility-function to add 'const' to variables
Jonas Toth via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sun Nov 11 12:16:56 PST 2018
JonasToth created this revision.
JonasToth added reviewers: aaron.ballman, hokein, alexfh, shuaiwang, lebedev.ri.
Herald added subscribers: cfe-commits, xazax.hun, mgorny.
JonasToth added a dependent revision: D45444: [clang-tidy] implement new check for const-correctness.
This patch extends the already existing facility to add 'const' to variables
to be more flexible and correct. The previous version did not consider pointers
as value AND pointee. For future automatic introduction for const-correctness
this shortcoming needs to be fixed.
It always allows configuration where the 'const' token is inserted, either on
the left side (if possible) or the right side.
It adds many unit-tests to the utility-function that did not exist before, as
the function was implicitly tested through clang-tidy checks. These
tests were not changed, as the API is still compatible.
rCTE Clang Tools Extra
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 47464 bytes
Desc: not available
More information about the cfe-commits