[clang-tools-extra] Enforce SL.con.3: Add check to replace operator[] with at() [Cont.] (PR #95220)

Paul Heidekrüger via cfe-commits cfe-commits at lists.llvm.org
Tue May 27 07:58:59 PDT 2025


paulhdk wrote:

Hi all!

I've requested reviews from everyone who has reviewed the check so far.
Would be awesome if we could get this merged soon! Attaching my previous comments with unresolved questions below.

> Based on what @leunam99 wrote above, the following questions are still unresolved:
> 
> * It is still unclear to us how templates should be addressed when suggesting fixes.
   For instance, what should happen in this case:
  https://github.com/llvm/llvm-project/blob/98483ae1581c9a12fc7b4c8b5b64330db8292c29/clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/pro-bounds-avoid-unchecked-container-accesses.cpp?plain=1#L176-L184
> 
> * Should we worry about the cases where the subscript operator can have 0 parameters or more than 1 parameter in C++23? At the moment we’re accounting for the case where there is no parameter, but don't explicitly handle multiple parameters.
> 
> * As @carlosgalvezp noted, there are still open comments. I’ve resolved them or responded to those that we’re uncertain about. @PiotrZSL, it would be great if you could have another look!

Thank you!

https://github.com/llvm/llvm-project/pull/95220


More information about the cfe-commits mailing list