[PATCH] D19865: [clang-tidy] - PerformanceUnnecesaryCopyInitialization - only trigger for decl stmts with single VarDecl.

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Fri May 6 02:34:18 PDT 2016


alexfh added a comment.

In http://reviews.llvm.org/D19865#423140, @flx wrote:

> In http://reviews.llvm.org/D19865#419905, @flx wrote:
>
> > In http://reviews.llvm.org/D19865#419830, @alexfh wrote:
> >
> > > Is it a workaround to avoid breaking the code by incorrect fixes?
> >
> >
> > Yes. We can't simply change the type of DeclStmt when we only look one of the VarDecls and how it is initialized.
>
>
> Also, all tests still pass. Alex, do you have any particular concern with this approach?


Even if we can't easily provide an automated fix (we could teach the check to split declarations, but it might not worth the effort), we could still emit a warning. WDYT?


Repository:
  rL LLVM

http://reviews.llvm.org/D19865





More information about the cfe-commits mailing list