summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/misc/UnusedUsingDeclsCheck.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [clang-tidy] Fix a false positive in unused-using-decl checkHaojian Wu2019-09-031-30/+47
| | | | | | | | | | The previous matcher "hasAnyTemplateArgument(templateArgument())" only matches the first template argument, but the check wants to iterate all template arguments. This patch fixes this. Also some refactorings in this patch (to make the code reusable). llvm-svn: 370760
* Fix clang-tidy warning in clang-tidyBenjamin Kramer2019-08-231-1/+1
| | | | | | | | argument name 'FixDescription' in comment does not match parameter name 'Description' Patch by Nils Barth! llvm-svn: 369783
* [clang-tidy] Add fix descriptions to clang-tidy checks.Haojian Wu2019-04-171-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Motivation/Context: in the code review system integrating with clang-tidy, clang-tidy doesn't provide a human-readable description of the fix. Usually developers have to preview a code diff (before vs after apply the fix) to understand what the fix does before applying a fix. This patch proposes that each clang-tidy check provides a short and actional fix description that can be shown in the UI, so that users can know what the fix does without previewing diff. This patch extends clang-tidy framework to support fix descriptions (will add implementations for existing checks in the future). Fix descriptions and fixes are emitted via diagnostic::Note (rather than attaching the main warning diagnostic). Before this patch: ``` void MyCheck::check(...) { ... diag(loc, "my check warning") << FixtItHint::CreateReplacement(...); } ``` After: ``` void MyCheck::check(...) { ... diag(loc, "my check warning"); // Emit a check warning diag(loc, "fix description", DiagnosticIDs::Note) << FixtItHint::CreateReplacement(...); // Emit a diagnostic note and a fix } ``` Reviewers: sammccall, alexfh Reviewed By: alexfh Subscribers: MyDeveloperDay, Eugene.Zelenko, aaron.ballman, JonasToth, xazax.hun, jdoerfert, cfe-commits Tags: #clang-tools-extra, #clang Differential Revision: https://reviews.llvm.org/D59932 llvm-svn: 358576
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* Port getLocEnd -> getEndLocStephen Kelly2018-08-091-1/+1
| | | | | | | | Subscribers: nemanjai, ioeric, kbarton, cfe-commits Differential Revision: https://reviews.llvm.org/D50355 llvm-svn: 339401
* Port getLocStart -> getBeginLocStephen Kelly2018-08-091-1/+1
| | | | | | | | | | Reviewers: javed.absar Subscribers: nemanjai, kbarton, ilya-biryukov, ioeric, jkorous, arphaman, jfb, cfe-commits Differential Revision: https://reviews.llvm.org/D50354 llvm-svn: 339400
* [clang-tidy] Fix misc-unused-using-decls false positives in presence of ↵Alexander Kornienko2017-02-091-0/+3
| | | | | | compile errors llvm-svn: 294578
* [clang-tools-extra] Format sources with clang-format. NFC.Mandeep Singh Grang2016-11-081-3/+4
| | | | | | | | | | | | | | | | Summary: Ran clang-format on all .c/.cpp/.h files in clang-tools-extra. Excluded the test, unittests, clang-reorder-fields, include-fixer, modularize and pptrace directories. Reviewers: klimek, alexfh Subscribers: nemanjai Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D26329 llvm-svn: 286221
* [clang-tidy] Fix template agrument false positives in unused-using-decls.Haojian Wu2016-10-111-0/+14
| | | | | | | | | | | | | | Summary: * Fix a false postive when an using class is used in an explicit template instantiation. * Fix a false postive when an using template class is used as template argument. Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25437 llvm-svn: 283879
* [clang-tidy] Cleaning up language options.Gabor Horvath2016-09-241-2/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D24881 llvm-svn: 282319
* [clang-tidy] Fix an unused-using-decl false positive about template arguments inHaojian Wu2016-08-021-3/+17
| | | | | | | | | | | | | | | | function call expression. Summary: The check doesn't mark the template argument as used when the template argument is a template. Reviewers: djasper, alexfh Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D22803 llvm-svn: 277444
* [clang-tidy] Fix more enum declaration cases in misc-unused-using-decls check.Haojian Wu2016-07-041-0/+3
| | | | | | | | | | | | Summary: Fix PR28350. Reviewers: alexfh Subscribers: aaron.ballman, Eugene.Zelenko, cfe-commits Differential Revision: http://reviews.llvm.org/D21833 llvm-svn: 274496
* [clang-tidy] Warning enum unused using declarations.Haojian Wu2016-06-271-3/+6
| | | | | | | | | | Reviewers: alexfh, aaron.ballman Subscribers: aaron.ballman, cfe-commits Differential Revision: http://reviews.llvm.org/D21747 llvm-svn: 273882
* [clang-tidy] Ignore function context in misc-unused-using-decls.Haojian Wu2016-06-031-5/+14
| | | | | | | | | | | | Summary: Make the check's behavior more correct when handling using-decls in multiple scopes. Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D20909 llvm-svn: 271632
* Fix a wrong check in misc-unused-using-declsHaojian Wu2016-05-301-13/+11
| | | | | | | | | | | | | | Summary: We should check whether a UsingDecl is defined in macros or in class definition, not TargetDecls of the UsingDecl. Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D20666 llvm-svn: 271199
* [clang-tidy] Handle using-decls with more than one shadow decl.Haojian Wu2016-05-201-32/+41
| | | | | | | | | | Reviewers: alexfh Subscribers: cfe-commits, djasper Differential Revision: http://reviews.llvm.org/D20429 llvm-svn: 270191
* [clang-tidy] Use unresolvedLookupExpr node matcher from ASTMatcher.Haojian Wu2016-05-181-7/+0
| | | | | | | | | | Reviewers: alexfh, aaron.ballman Subscribers: aaron.ballman, cfe-commits Differential Revision: http://reviews.llvm.org/D20367 llvm-svn: 269928
* [clang-tidy] Fix a template function false positive in ↵Haojian Wu2016-05-181-0/+16
| | | | | | | | | | | | | | misc-unused-using-decls check. Summary: Ignore warning uninstantiated template function usages. Reviewers: djasper, alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D20326 llvm-svn: 269906
* [clang-tidy] Ignore using-declarations defined in marcro in ↵Haojian Wu2016-05-121-0/+4
| | | | | | | | | | | | misc-unused-using-decls checks. Reviewers: djasper Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D20197 llvm-svn: 269278
* Support variables and functions types in misc-unused-using-decls.Haojian Wu2016-05-091-5/+27
| | | | | | | | | | | | Summary: Fix PR27429. Reviewers: djasper Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D20018 llvm-svn: 268917
* clang-tidy: [misc-unused-using-decls] Support template types.Daniel Jasper2016-04-201-3/+7
| | | | | | This fixes llvm.org/PR27429. llvm-svn: 266866
* clang-tidy: [misc-unused-using-decls] Always use the canonical decl toDaniel Jasper2016-04-201-3/+5
| | | | | | | | identify things. This fixes llvm.org/PR27430. llvm-svn: 266864
* Initial version of misc-unused-using-decl check.Daniel Jasper2016-04-191-0/+73
llvm-svn: 266735
OpenPOWER on IntegriCloud