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*
Differential D158152
[clang-tidy]mark record initList as non-const param Authored by HerrCai0907 on Aug 17 2023, 12:33 AM.
Details 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 Timeline
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.
| ||||||||||||||||||
Add a test with XYConst hidden behind typedef.
like
typedef XYConst XYConstTypedef; XYConstTypedef yz = {x};