struct XY { int *x; int *y; }; void recordInitList(int *x) { XY xy = {x, nullptr}; }
x cannot be const int* becase it in a initialize list which only accept int*
Paths
| Differential D158152
[clang-tidy]mark record initList as non-const param ClosedPublic Authored by HerrCai0907 on Aug 17 2023, 12:33 AM.
Details Summary struct XY { int *x; int *y; }; void recordInitList(int *x) { XY xy = {x, nullptr}; } x cannot be const int* becase it in a initialize list which only accept int*
Diff Detail
Event TimelineEugene.Zelenko added inline comments.
Comment Actions LGTM, but note that type aliases may not work properly, but that more a legacy issue that got source in line 104, simply because we should use canonical type there.
This revision is now accepted and ready to land.Aug 21 2023, 7:50 AM This revision was landed with ongoing or failed builds.Aug 21 2023, 8:43 PM Closed by commit rG1c9412441b87: [clang-tidy]mark record initList as non-const param (authored by HerrCai0907). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 552201 clang-tools-extra/clang-tidy/readability/NonConstParameterCheck.cpp
clang-tools-extra/docs/ReleaseNotes.rst
clang-tools-extra/test/clang-tidy/checkers/readability/non-const-parameter.cpp
|