[PATCH] D24656: [clang-tidy] Add check readability-redundant-declaration

2016-11-02 Thread Alexander Kornienko via cfe-commits
alexfh added inline comments. Comment at: clang-tools-extra/trunk/test/clang-tidy/readability-redundant-declaration.cpp:11 +extern int A, B; +// CHECK-MESSAGES: :[[@LINE-1]]:12: warning: redundant 'A' declaration +// CHECK-FIXES: {{^}}extern int A, B;{{$}} Just

[PATCH] D24656: [clang-tidy] Add check readability-redundant-declaration

2016-11-01 Thread Daniel Marjamäki via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL285689: [clang-tidy] Add check readability-redundant-declaration (authored by danielmarjamaki). Changed prior to commit: https://reviews.llvm.org/D24656?vs=74478&id=76548#toc Repository: rL LLVM htt

[PATCH] D24656: [clang-tidy] Add check readability-redundant-declaration

2016-10-22 Thread Alexander Kornienko via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. Sorry for the delay. I'm on vacation, returning on Monday. The patch looks good when the comments are fixed. Comment at: clang-tidy/readability/RedundantDeclarationCheck.cpp

[PATCH] D24656: [clang-tidy] Add check readability-redundant-declaration

2016-10-18 Thread Daniel Marjamäki via cfe-commits
danielmarjamaki added a comment. Ping. Repository: rL LLVM https://reviews.llvm.org/D24656 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D24656: [clang-tidy] Add check readability-redundant-declaration

2016-10-13 Thread Daniel Marjamäki via cfe-commits
danielmarjamaki set the repository for this revision to rL LLVM. danielmarjamaki updated this revision to Diff 74478. danielmarjamaki added a comment. Herald added a subscriber: modocache. changed cast(D)->getName() to cast(D) Repository: rL LLVM https://reviews.llvm.org/D24656 Files: clan

[PATCH] D24656: [clang-tidy] Add check readability-redundant-declaration

2016-10-12 Thread Aaron Ballman via cfe-commits
aaron.ballman added inline comments. Comment at: clang-tidy/readability/RedundantDeclarationCheck.cpp:60 +auto Diag = diag(D->getLocation(), "redundant '%0' declaration") +<< cast(D)->getName(); +if (!MultiVar && !DifferentHeaders) danielmarjamaki

[PATCH] D24656: [clang-tidy] Add check readability-redundant-declaration

2016-10-12 Thread Daniel Marjamäki via cfe-commits
danielmarjamaki added inline comments. Comment at: clang-tidy/readability/RedundantDeclarationCheck.cpp:60 +auto Diag = diag(D->getLocation(), "redundant '%0' declaration") +<< cast(D)->getName(); +if (!MultiVar && !DifferentHeaders) alexfh wrote:

[PATCH] D24656: [clang-tidy] Add check readability-redundant-declaration

2016-10-10 Thread Alexander Kornienko via cfe-commits
alexfh requested changes to this revision. alexfh added inline comments. This revision now requires changes to proceed. Comment at: clang-tidy/readability/RedundantDeclarationCheck.cpp:39 + bool MultiVar = false; + if (const auto *VD = dyn_cast(D)) { +if (VD && VD->getPrevi

[PATCH] D24656: [clang-tidy] Add check readability-redundant-declaration

2016-10-05 Thread Daniel Marjamäki via cfe-commits
danielmarjamaki marked 2 inline comments as done. danielmarjamaki added a comment. Ping. I am not very happy about how I detect multivariable declarations. But I really don't see any such info in the VarDecl. For instance, the AST dump does not show this info. https://reviews.llvm.org/D24656

Re: [PATCH] D24656: [clang-tidy] Add check readability-redundant-declaration

2016-09-28 Thread Daniel Marjamäki via cfe-commits
danielmarjamaki marked 3 inline comments as done. Comment at: clang-tidy/readability/RedundantDeclarationCheck.cpp:39 @@ +38,3 @@ + bool MultiVar = false; + if (const auto *VD = dyn_cast(D)) { +if (VD && VD->getPreviousDecl()->getStorageClass() == SC_Extern && --

Re: [PATCH] D24656: [clang-tidy] Add check readability-redundant-declaration

2016-09-28 Thread Daniel Marjamäki via cfe-commits
danielmarjamaki updated this revision to Diff 72802. danielmarjamaki added a comment. Fix review comments https://reviews.llvm.org/D24656 Files: clang-tidy/readability/CMakeLists.txt clang-tidy/readability/ReadabilityTidyModule.cpp clang-tidy/readability/RedundantDeclarationCheck.cpp cl

Re: [PATCH] D24656: [clang-tidy] Add check readability-redundant-declaration

2016-09-23 Thread Alexander Kornienko via cfe-commits
alexfh requested changes to this revision. alexfh added a comment. This revision now requires changes to proceed. If this kind of an error is not too frequent, it might make sense as a clang diagnostic, indeed. Having it in clang-tidy until then doesn't hurt, though. Comment at

Re: [PATCH] D24656: [clang-tidy] Add check readability-redundant-declaration

2016-09-19 Thread Daniel Marjamäki via cfe-commits
danielmarjamaki marked an inline comment as done. danielmarjamaki added a comment. https://reviews.llvm.org/D24656 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D24656: [clang-tidy] Add check readability-redundant-declaration

2016-09-19 Thread Daniel Marjamäki via cfe-commits
danielmarjamaki removed rL LLVM as the repository for this revision. danielmarjamaki updated this revision to Diff 71775. danielmarjamaki added a comment. run clang-format on test. add release notes. https://reviews.llvm.org/D24656 Files: clang-tidy/readability/CMakeLists.txt clang-tidy/rea

Re: [PATCH] D24656: [clang-tidy] Add check readability-redundant-declaration

2016-09-19 Thread Daniel Marjamäki via cfe-commits
danielmarjamaki added a comment. > Will be good idea to detect redundant function prototypes. Yes. Should that have the same ID though? Is it better to have one readability-redundant-declaration or two separate readability-redundant-variable-declaration and readability-redundant-function-dec

Re: [PATCH] D24656: [clang-tidy] Add check readability-redundant-declaration

2016-09-18 Thread Daniel Marjamäki via cfe-commits
danielmarjamaki added a comment. > However, I think this check should be part of Clang diagnostics. GCC has > -Wredundant-decls for a long time. I am not against that. What is the criteria? When should it be in the compiler and when should it be in clang-tidy? Personally I think it's natural

Re: [PATCH] D24656: [clang-tidy] Add check readability-redundant-declaration

2016-09-16 Thread Eugene Zelenko via cfe-commits
Eugene.Zelenko added inline comments. Comment at: test/clang-tidy/readability-redundant-declaration.cpp:9 @@ +8,3 @@ +extern int A; +extern int A,B; +// CHECK-MESSAGES: :[[@LINE-1]]:12: warning: redundant variable A declaration Please run Clang-format over test.

Re: [PATCH] D24656: [clang-tidy] Add check readability-redundant-declaration

2016-09-16 Thread Eugene Zelenko via cfe-commits
Eugene.Zelenko added a subscriber: Eugene.Zelenko. Eugene.Zelenko added a comment. Please mention this check in docs/ReleaseNotes.rst (in alphabetical order). Will be good idea to detect redundant function prototypes. However, I think this check should be part of Clang diagnostics. GCC has -Wre

Re: [PATCH] D24656: [clang-tidy] Add check readability-redundant-declaration

2016-09-16 Thread Daniel Marjamäki via cfe-commits
danielmarjamaki marked 2 inline comments as done. danielmarjamaki added a comment. https://reviews.llvm.org/D24656 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D24656: [clang-tidy] Add check readability-redundant-declaration

2016-09-16 Thread Daniel Marjamäki via cfe-commits
danielmarjamaki updated this revision to Diff 71614. danielmarjamaki added a comment. minor fixes https://reviews.llvm.org/D24656 Files: clang-tidy/readability/CMakeLists.txt clang-tidy/readability/ReadabilityTidyModule.cpp clang-tidy/readability/RedundantDeclarationCheck.cpp clang-tidy

Re: [PATCH] D24656: [clang-tidy] Add check readability-redundant-declaration

2016-09-16 Thread Daniel Marjamäki via cfe-commits
danielmarjamaki added a comment. For information, I am testing this on debian packages right now. I will see the results next week. Comment at: clang-tidy/readability/RedundantDeclarationCheck.cpp:22 @@ +21,3 @@ +void RedundantDeclarationCheck::registerMatchers(MatchFinder *Fin

[PATCH] D24656: [clang-tidy] Add check readability-redundant-declaration

2016-09-16 Thread Daniel Marjamäki via cfe-commits
danielmarjamaki created this revision. danielmarjamaki added a reviewer: alexfh. danielmarjamaki added a subscriber: cfe-commits. Herald added subscribers: mgorny, beanz. This is a new check that warns about redundant variable declarations. https://reviews.llvm.org/D24656 Files: clang-tidy/rea