summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test
Commit message (Collapse)AuthorAgeFilesLines
* clang-tidy: Add checker that warn when macro argument with side effects is ↵Daniel Marjamaki2015-06-171-0/+84
| | | | | | repeated in the macro llvm-svn: 239909
* clang-tidy: Add checker that warns about missing parentheses in macrosDaniel Marjamaki2015-06-161-0/+36
| | | | | | | * calculations in the replacement list should be inside parentheses * macro arguments should be inside parentheses llvm-svn: 239820
* Fixed modularize to warn about missing headers referenced in a module map.John Thompson2015-06-043-0/+14
| | | | llvm-svn: 239122
* [clang-tidy] Fix for llvm.org/PR23355Szabolcs Sipos2015-05-292-1/+18
| | | | | | misc-static-assert and misc-assert-side-effect will handle __builtin_expect based asserts correctly. llvm-svn: 238548
* [clang-tidy] Renamed misc-noexcept-move-ctors to misc-noexcept-move-constructorAlexander Kornienko2015-05-271-3/+3
| | | | llvm-svn: 238326
* [clang-tidy] misc-noexcept-move-ctors should ignore implicit constructors ↵Alexander Kornienko2015-05-261-0/+8
| | | | | | and assignments. llvm-svn: 238202
* [clang-tidy] Don't issue most google-readability-casting warnings on .c ↵Alexander Kornienko2015-05-261-0/+11
| | | | | | | | | files included in other files. This is done sometimes for testing purposes, and the check needs to handle this consistently. llvm-svn: 238193
* [clang-tidy] Fix for llvm.org/PR23572Szabolcs Sipos2015-05-231-0/+6
| | | | | | misc-static-assert won't report asserts whose conditions contain calls to non constexpr functions. llvm-svn: 238098
* Add a clang-tidy check for move constructors/assignment ops without noexcept.Alexander Kornienko2015-05-221-0/+37
| | | | | | | | | | | | | | | | | | Summary: Add a clang-tidy check (misc-noexcept-move-ctors) for move constructors and assignment operators not using noexcept. http://llvm.org/PR23519 Reviewers: klimek Reviewed By: klimek Subscribers: curdeius, cfe-commits Differential Revision: http://reviews.llvm.org/D9933 llvm-svn: 238013
* [clang-tidy] Disable google-readability-casting for .c files and their headers.Alexander Kornienko2015-05-211-0/+3
| | | | | | | | | Some people have reasons to compile their .c files as C++ in some configurations (e.g. for testing purposes), so just looking at LangOptions is not enough. This patch disables the check on all .c files (and also for the headers included from .c files). llvm-svn: 237905
* Copy lit shell changes from clang to clang-tools-extra, excluding some ↵Reid Kleckner2015-05-202-3/+18
| | | | | | failing tests llvm-svn: 237832
* [clang-tidy] Enhance clang-tidy readability-simplify-boolean-expr check...Alexander Kornienko2015-05-173-0/+120
| | | | | | | | | | | | | | | | Enhance clang-tidy readability-simplify-boolean-expr check to handle chained conditional assignment and chained conditional return. Based on feedback from applying this tool to the clang/LLVM codebase, this changeset improves the readability-simplify-boolean-expr check so that conditional assignment or return statements at the end of a chain of if/else if statements are left unchanged unless a configuration option is supplied. http://reviews.llvm.org/D8996 Patch by Richard Thomson! llvm-svn: 237541
* [clang-tidy] Treat all types with non-trivial destructors as RAII.Alexander Kornienko2015-05-121-0/+8
| | | | | | | This solves some false negatives at a cost of adding some false positives that can be fixed easily and (almost) automatically. llvm-svn: 237120
* [clang-tidy] Fix for llvm.org/PR23161Szabolcs Sipos2015-05-081-0/+6
| | | | | | | | | | The misc-static-assert check will not warn on the followings: assert(NULL == "shouldn't warn"); assert(__null == "shouldn't warn"); Where NULL is a macro defined as __null. llvm-svn: 236812
* Update to match clang r236404.Richard Smith2015-05-042-12/+12
| | | | llvm-svn: 236405
* Revert r236001, "Disable ↵NAKAMURA Takumi2015-05-011-3/+0
| | | | | | | | clang-tools-extra/test/pp-trace/pp-trace-modules.cpp on win32 for now. Investigating." It has been resolved. llvm-svn: 236309
* Disable clang-tools-extra/test/pp-trace/pp-trace-modules.cpp on win32 for ↵NAKAMURA Takumi2015-04-281-0/+3
| | | | | | now. Investigating. llvm-svn: 236001
* clang-tidy: [readability-else-after-return] Fix false positive. ThisDaniel Jasper2015-04-271-0/+7
| | | | | | | might be a little too strict now, but better be too strict than do the wrong thing. llvm-svn: 235932
* [clang-tidy] Add readability-simplify-boolean-expr check to clang-tidyAlexander Kornienko2015-04-101-0/+543
| | | | | | | | | | | | | | | | | | | | | | | | | | | This check looks for comparisons between boolean expressions and boolean constants and simplifies them to just use the appropriate boolean expression directly. if (b == true) becomes if (b) if (b == false) becomes if (!b) if (b && true) becomes if (b) if (b && false) becomes if (false) if (b || true) becomes if (true) if (b || false) becomes if (b) e ? true : false becomes e e ? false : true becomes !e if (true) t(); else f(); becomes t(); if (false) t(); else f(); becomes f(); if (e) return true; else return false; becomes return (e); if (e) return false; else return true; becomes return !(e); if (e) b = true; else b = false; becomes b = e; if (e) b = false; else b = true; becomes b = !(e); http://reviews.llvm.org/D7648 Patch by Richard Thomson! llvm-svn: 234626
* [clang-tidy] Fix for llvm.org/PR23161Szabolcs Sipos2015-04-101-0/+19
| | | | | | | | The misc-static-assert check will not warn on the followings: assert("Some message" == NULL); assert(NULL == "Some message"); llvm-svn: 234596
* [clang-tidy] Ignore expressions with incompatible deleters.Samuel Benzaquen2015-04-091-4/+26
| | | | | | | | | | | | | | | Summary: Do not warn on .reset(.release()) expressions if the deleters are not compatible. Using plain assignment will probably not work. Reviewers: klimek Subscribers: curdeius, cfe-commits Differential Revision: http://reviews.llvm.org/D8422 llvm-svn: 234512
* [clang-tidy] Fix for http://llvm.org/PR23130Alexander Kornienko2015-04-081-3/+2
| | | | | | | NamespaceCommentCheck: Don't remove the token placed immediately after the namespace closing brace. llvm-svn: 234403
* [clang-tidy] Added a couple of tests for misc-static-assert.Alexander Kornienko2015-04-041-0/+9
| | | | llvm-svn: 234094
* [clang-tidy] Clarify message for the google-explicit-constructor checkAlexander Kornienko2015-03-311-1/+6
| | | | | | | | Use "constructors that are callable with a single argument" instead of "single-argument constructors" when referring to constructors using default arguments or parameter packs. llvm-svn: 233702
* [clang-tidy] Move google-readability-function check to ↵Alexander Kornienko2015-03-161-1/+1
| | | | | | | | | | | | | | | | readability-named-parameter. Summary: The relevant style rule is going to be removed, thus the check is no longer needed in the Google module. Leaving the check in readability/ in case someone needs it. Reviewers: djasper Reviewed By: djasper Subscribers: curdeius, cfe-commits Differential Revision: http://reviews.llvm.org/D8261 llvm-svn: 232431
* Move remove-cstr-calls from a standalone executable to a clang-tidy check ↵Alexander Kornienko2015-03-163-40/+42
| | | | | | | | | | readability-redundant-string-cstr http://reviews.llvm.org/D7318 Patch by Richard Thomson! llvm-svn: 232338
* [clang-tidy] Fix false positives in the misc-static-assert check ↵Alexander Kornienko2015-03-151-0/+8
| | | | | | | | | | | | | | | | http://llvm.org/PR22880 The misc-static-assert check will not warn on assert(false), assert(False), assert(FALSE); where false / False / FALSE are macros expanding to the false or 0 literals. Also added corresponding test cases. http://reviews.llvm.org/D8328 Patch by Szabolcs Sipos! llvm-svn: 232306
* [clang-tidy] Static Analyzer checker configuration options pass-through.Gabor Horvath2015-03-111-0/+19
| | | | | | | | Reviewed by: Alexander Kornienko Differential Revision: http://reviews.llvm.org/D8164 llvm-svn: 231941
* [clang-tidy] Fix assertion when a dependent expression is used in an assert.Alexander Kornienko2015-03-091-0/+2
| | | | llvm-svn: 231620
* [clang-tidy] Fix diag message in clang-tidy misc-uniqueptr-reset-release if ↵Alexander Kornienko2015-03-051-1/+1
| | | | | | | | | | right side is rvalue http://reviews.llvm.org/D8071 Patch by Alexey Sokolov! llvm-svn: 231365
* [clang-tidy] Output more diagnostics in check_clang_tidy.shAlexander Kornienko2015-03-041-0/+9
| | | | | | Print clang-tidy output and fixes applied. llvm-svn: 231236
* Add -fexceptions for targets which need itFilipe Cabecinhas2015-03-021-1/+1
| | | | llvm-svn: 230994
* [clang-tidy] Assert related checkersAlexander Kornienko2015-03-022-0/+172
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch contains two assert related checkers. These checkers are the part of those that is being open sourced by Ericsson (http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-December/040520.html). The checkers: AssertSideEffect: /// \brief Finds \c assert() with side effect. /// /// The conition of \c assert() is evaluated only in debug builds so a condition /// with side effect can cause different behaviour in debug / relesase builds. StaticAssert: /// \brief Replaces \c assert() with \c static_assert() if the condition is /// evaluatable at compile time. /// /// The condition of \c static_assert() is evaluated at compile time which is /// safer and more efficient. http://reviews.llvm.org/D7375 Patch by Szabolcs Sipos! llvm-svn: 230943
* [clang-tidy] Various improvements in misc-use-overrideAlexander Kornienko2015-02-273-36/+66
| | | | | | | | | | | * Better error message when more than one of 'virtual', 'override' and 'final' is present ("X is/are redundant since the function is already declared Y"). * Convert the messages to the style used in Clang diagnostics: lower case initial letter, no trailing period. * Don't run the check for files compiled in pre-C++11 mode (http://llvm.org/PR22638). llvm-svn: 230765
* [clang-tidy] Correct spelling error in test file name. NFC.Alexander Kornienko2015-02-251-0/+0
| | | | | | | Patch by Richard Thomson! http://reviews.llvm.org/D7603 llvm-svn: 230491
* [clang-tidy] Fixed a false positive case in misc-inaccurate-erase checker.Gabor Horvath2015-02-251-2/+12
| | | | llvm-svn: 230483
* Revert "Add a missing target requirement."Adrian Prantl2015-02-251-1/+1
| | | | | | This reverts commit 230430. llvm-svn: 230455
* Add a missing target requirement.Adrian Prantl2015-02-251-1/+1
| | | | llvm-svn: 230430
* Deleted module-map-checker, as it's been folded into modularize.John Thompson2015-02-2019-65/+0
| | | | llvm-svn: 230014
* Added module map coverage support, extracted from module-map-checker.John Thompson2015-02-1919-1/+65
| | | | llvm-svn: 229869
* Fixed missing checkins.John Thompson2015-02-182-0/+18
| | | | llvm-svn: 229699
* Added support for extracting headers from module maps as a source for the ↵John Thompson2015-02-182-0/+2
| | | | | | header list. llvm-svn: 229692
* [clang-tidy] Fixed two wrong fix-it cases in misc-inefficient-algorithm checker.Gabor Horvath2015-02-171-3/+40
| | | | llvm-svn: 229552
* clang-tools-extra/test/modularize/NoProblemsList.modularize: Unbreak test.NAKAMURA Takumi2015-02-131-1/+1
| | | | | | Don't expect the list were on the current directory. llvm-svn: 228991
* [clang-tidy] Fixed a false positive case in misc-inefficient-algorithm checker.Gabor Horvath2015-02-121-0/+4
| | | | llvm-svn: 228945
* Fix broken test in separate build tree.John Thompson2015-02-121-1/+1
| | | | llvm-svn: 228941
* Added support for multiple header list files, as a precursor for when we ↵John Thompson2015-02-121-0/+2
| | | | | | need to load multiple module maps. llvm-svn: 228935
* Added -block-check-header-list-only option. This is a work-around for ↵John Thompson2015-02-111-0/+3
| | | | | | private includes that purposefully get included inside blocks. llvm-svn: 228846
* Renamed module.map to module.modulemap.John Thompson2015-02-104-6/+6
| | | | llvm-svn: 228692
* [clang-tidy] Checker for inaccurate use of erase() method.Gabor Horvath2015-02-101-0/+67
| | | | | | | | | | | | | | Algorithms like remove() does not actually remove any element from the container but returns an iterator to the first redundant element at the end of the container. These redundant elements must be removed using the erase() method. This check warns when not all of the elements will be removed due to using an inappropriate overload. Reviewer: alexfh Differential Revision: http://reviews.llvm.org/D7496 llvm-svn: 228679
OpenPOWER on IntegriCloud