hokein added a comment. In https://reviews.llvm.org/D54704#1304176, @aaron.ballman wrote:
> > 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})); > > This code isn't legal in the first place. ;-) Thanks for the review. Fixed :) ================ Comment at: clang-tidy/modernize/MakeSmartPtrCheck.cpp:287 + // Foo(Bar{1, 2}) => true + // Foo(1) => false + auto HasListIntializedArgument = [](const CXXConstructExpr *CE) { ---------------- aaron.ballman wrote: > I assume this is expected to be false? `Foo{1}` Yes, added this sample to the comment. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D54704 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits