[PATCH] D54704: [clang-tidy] Don't generate incorrect fixes for class constructed from list-initialized arguments

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 19 08:37:02 PST 2018


hokein created this revision.
hokein added a reviewer: aaron.ballman.
Herald added a subscriber: xazax.hun.

Currently the smart_ptr check (modernize-make-unique) generates the
fixes that cannot compile for cases like below -- because brace list can
not be deduced in `make_unique`.

  class Bar { int a, b; };
  class Foo { Foo(Bar); };
  auto foo = std::unique_ptr<Foo>(new Foo({1, 2}));


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D54704

Files:
  clang-tidy/modernize/MakeSmartPtrCheck.cpp
  test/clang-tidy/modernize-make-unique.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54704.174623.patch
Type: text/x-patch
Size: 6517 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181119/8f949629/attachment-0001.bin>


More information about the cfe-commits mailing list