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

Felix Berger via cfe-commits cfe-commits at lists.llvm.org
Mon May 9 07:23:26 PDT 2016


flx 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?




In http://reviews.llvm.org/D19865#423286, @alexfh wrote:

> 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?


Sounds good. Done. We now still issue the warning, but don't issue fixes when it's not a single decl.


http://reviews.llvm.org/D19865





More information about the cfe-commits mailing list