summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/misc/UnusedRAII.h
Commit message (Collapse)AuthorAgeFilesLines
* [clang-tidy] Refactor: Rename clang-tidy misc check files and classes to ↵Alexander Kornienko2015-03-091-51/+0
| | | | | | | | | | | | | follow naming conventions Classes are named WhateverCheck, files are named WhateverCheck.cpp and WhateverCheck.h. http://reviews.llvm.org/D8145 Patch by Richard Thomson! llvm-svn: 231648
* [clang-tidy] Refactor: Move misc clang-tidy checks to namespace ↵Alexander Kornienko2015-03-021-0/+2
| | | | | | | | | | | | | clang::tidy::misc clang-tidy checks are organized into modules. This refactoring moves the misc module checks into the namespace clang::tidy::misc http://reviews.llvm.org/D7996 Patch by Richard Thomson! llvm-svn: 230950
* Implemented clang-tidy-check-specific options.Alexander Kornienko2014-09-121-0/+2
| | | | | | | | | | | | | | | | | Summary: Each check can implement readOptions and storeOptions methods to read and store custom options. Each check's options are stored in a local namespace to avoid name collisions and provide some sort of context to the user. Reviewers: bkramer, klimek Reviewed By: klimek Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D5296 llvm-svn: 217661
* Reapply r213647 with a fix.Benjamin Kramer2014-07-231-0/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | ASTMatchers currently have problems mixing bound TypeLoc nodes with Decl/Stmt nodes. That should be fixed soon but for this checker there we only need the TypeLoc to generate a fixit so postpone the potentially heavyweight AST walking until after we know that we're going to emit a warning. This is covered by existing test cases. Original message: [clang-tidy] Add a check for RAII temporaries. This tries to find code similar that immediately destroys an object that looks like it's trying to follow RAII. { scoped_lock(&global_mutex); critical_section(); } This checker will have false positives if someone uses this pattern to legitimately invoke a destructor immediately (or the statement is at the end of a scope anyway). To reduce the number we ignore this pattern in macros (this is heavily used by gtest) and ignore objects with no user-defined destructor. llvm-svn: 213738
* Revert r213647; the added test triggers an assertion.Richard Smith2014-07-231-47/+0
| | | | llvm-svn: 213722
* [clang-tidy] Add a check for RAII temporaries.Benjamin Kramer2014-07-221-0/+47
Summary: This tries to find code similar that immediately destroys an object that looks like it's trying to follow RAII. { scoped_lock(&global_mutex); critical_section(); } This checker will have false positives if someone uses this pattern to legitimately invoke a destructor immediately (or the statement is at the end of a scope anyway). To reduce the number we ignore this pattern in macros (this is heavily used by gtest) and ignore objects with no user-defined destructor. Reviewers: alexfh, djasper Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4615 llvm-svn: 213647
OpenPOWER on IntegriCloud