llvm / llvm/llvm-project

readability-container-data-pointer should warn for `.at(0)` and `.front()`.

Open
#180,259 1 comment 0 reactions 0 assignees View on GitHub
clang-tidy enhancement
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

Presently `&vec[0]` warns but `&vec.front()` and `&vec.at(0)` and `&*vec.begin()` do not. Granted `vec.at(0)` is really "throw if `vec.empty()` then `vec.data()`..." so can't be replaced as a pure refactor.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.