gribozavr added inline comments.
================ Comment at: clang-tools-extra/clang-tidy/modernize/MakeSmartPtrCheck.cpp:311 + } + } + if (CEArg->isStdInitListInitialization()) ---------------- So `Foo(Bar{1, 2})` is not problematic, it is just that we can't tell it apart from `Foo({1,2})`? ================ Comment at: clang-tools-extra/test/clang-tidy/modernize-make-unique.cpp:457 // CHECK-MESSAGES: :[[@LINE-1]]:28: warning: use std::make_unique instead - // CHECK-FIXES: std::unique_ptr<J> PJ2 = std::make_unique<J>(E{1, 2}, 1); + // CHECK-FIXES: std::unique_ptr<J> PJ2 = std::unique_ptr<J>(new J(E{1, 2}, 1)); PJ2.reset(new J(E{1, 2}, 1)); ---------------- hokein wrote: > gribozavr wrote: > > Why do we print the warning if the fixit is not fixing anything? > We may still want to inform users, these cases can still be converted to > `make_unique`, but the check currently is not smart enough to give correct > fixes. Sorry I don't understand -- so what the file used to say, `std::make_unique<J>(E{1, 2}, 1)`, is correct, and this patch introduces a regression? Or is some other syntax necessary? Please add FIXMEs anyway. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62736/new/ https://reviews.llvm.org/D62736 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits