This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Ignore a case where the fix of make_unique check introduces side effect.
ClosedPublic

Authored by hokein on Oct 17 2018, 8:13 AM.

Details

Summary

Previously, ptr.reset(new char[5]) will be replaced with `p =
make_unique<char[]>(5)`, the fix has side effect -- doing
default initialization, it may cause performace regression (we are
bitten by this rececntly)

The check should be conservative for these cases.

Diff Detail

Repository
rL LLVM

Event Timeline

hokein created this revision.Oct 17 2018, 8:13 AM
This revision is now accepted and ready to land.Oct 17 2018, 11:25 AM
This revision was automatically updated to reflect the committed changes.
This revision was automatically updated to reflect the committed changes.