Skip to content
Commit 8d2c095e authored by Chris Kennelly's avatar Chris Kennelly
Browse files

[clang-tidy] Omit std::make_unique/make_shared for default initialization.

This extends the check for default initialization in arrays added in
547f89d6 to include scalar types and exclude them from the suggested fix for
make_unique/make_shared.

Rewriting std::unique_ptr<int>(new int) as std::make_unique<int>() (or for
other, similar trivial T) switches from default initialization to value
initialization, a performance regression for trivial T.  For these use cases,
std::make_unique_for_overwrite is more suitable alternative.

Reviewed By: hokein

Differential Revision: https://reviews.llvm.org/D90392
parent 03e675fd
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment