[PATCH] D61642: [clang-tidy] Do not show incorrect fix in modernize-make-unique
Aaron Ballman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue May 7 09:04:50 PDT 2019
aaron.ballman marked an inline comment as done.
aaron.ballman added inline comments.
================
Comment at: clang-tools-extra/clang-tidy/modernize/MakeSmartPtrCheck.cpp:302
if (const auto *ImplicitCE =
dyn_cast<CXXConstructExpr>(Arg->IgnoreImplicit())) {
if (ImplicitCE->isStdInitListInitialization())
----------------
We can now remove the `IgnoreImplicit()` call here, can't we?
================
Comment at: clang-tools-extra/test/clang-tidy/modernize-make-unique.cpp:278
+ std::unique_ptr<APair> PAggrTemp = std::unique_ptr<APair>(new APair({T, 1}));
+ // CHECK-MESSAGES: :[[@LINE-1]]:38: warning: use std::make_unique instead
+ PAggrTemp.reset(new APair({T, 1}));
----------------
ilya-biryukov wrote:
> I'm wondering how to properly check that no fixes were produced here.
> Do we have a common way to express this?
> Would `CHECK-FIXES-NOT: ...` mentioning the line numbers somehow work?
I believe we typically use `CHECK-FIXES: <the original code blurb>` to ensure that the fix does not change any code.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D61642/new/
https://reviews.llvm.org/D61642
More information about the cfe-commits
mailing list