ChuanqiXu9 wrote: > > Can you make sure that at every place this PR touches `const` makes sense? > > I found out recently that we can be quite good at pretending that something > > is `const`, all the way down until we realize we need a `const_cast`, > > because modification is required in that one place. > > I'm not quite sure I understand the question. This PR doesn't add any > `const_cast`, and `const` is checked by the compiler so a successful build > shows that we're never modifying something declared `const`. What additional > work are you wanting?
The question is that it may be fine to be `const` today but it becomes not the case later. So we may have to make const function back to non-const function again. So one style to do such things is to understand that the new `const` decorated places are meant to be `const`. Otherwise I'll suggest to only mark the places that need to be change by the following patch as `const`. https://github.com/llvm/llvm-project/pull/93493 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits