Open
Description
Clangd version: 19.1.2
Using the T[]
specialization for make_unique
/make_unique_for_overwrite
and the resulting unique_ptr, clang-tidy reports that the template parameter should be replaced with std::array
.
Example:
std::unique_ptr<T[]> W = std::make_unique<T[]>(n);
std::unique_ptr<T[]> X = std::make_unique_for_overwrite<T[]>(n);
std::shared_ptr<T[]> Y = std::make_shared<T[]>(n);
std::shared_ptr<T[]> Z = std::make_shared_for_overwrite<T[]>(n);
Every instance of T[]
in the example is flagged as violating cppcoreguidelines-avoid-c-arrays/modernize-avoid-c-arrays and suggests using std::array
instead, which doesn't seem feasible in the context.