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

Congcong Cai via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 10 20:23:24 PDT 2024


https://github.com/HerrCai0907 requested changes to this pull request.

`at` and `operator[]` in `std::map` have different meanings. `operator[]` will insert value if key does not exist but `at` won't. Please limit this check only for index containers instead of key-value containers.

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


More information about the cfe-commits mailing list