llvm-project/clang-tools-extra/test/clang-tidy
Angel Garcia Gomez 8dedeb0230 Add modernize-use-default check to clang-tidy.
Summary:
Add a check that replaces empty bodies of special member functions with '= default;'.
For now, it is only implemented for the default constructor and the destructor, which are the easier cases.
The copy-constructor and the copy-assignment operator cases will be implemented later.

I applied this check to the llvm code base and found 627 warnings (385 in llvm, 9 in compiler-rt, 220 in clang and 13 in clang-tools-extra).
Applying the fixes didn't break any build or test, it only caused a -Wpedantic warning in lib/Target/Mips/MipsOptionRecord.h:33 becaused it replaced
virtual ~MipsOptionRecord(){}; to virtual ~MipsOptionRecord()= default;;

Reviewers: klimek

Subscribers: george.burgess.iv, Eugene.Zelenko, alexfh, cfe-commits

Differential Revision: http://reviews.llvm.org/D13871

llvm-svn: 250897
2015-10-21 12:58:15 +00:00
..
Inputs Replacements in different files do not overlap. 2015-10-16 16:15:27 +00:00
basic.cpp [clang-tidy] Move the missing namespace comment warnings to the closing brace 2014-11-17 17:32:32 +00:00
cert-setlongjmp.cpp Adding a checker (cert-err52-cpp) that detects use of setjmp or longjmp in C++ code. Corresponds to the CERT C++ secure coding rule: https://www.securecoding.cert.org/confluence/pages/viewpage.action?pageId=1834 2015-10-08 19:54:43 +00:00
cert-variadic-function-def.cpp Loosening the restriction on variadic function definitions so that extern "C" function definitions are permissible. 2015-10-07 15:14:10 +00:00
check_clang_tidy.py [clang-tidy] Better diagnostic in tests when clang-tidy fails. 2015-09-30 10:41:53 +00:00
clang-tidy-diff.cpp [clang-tidy] Move misc-use-override and readability-shrink-to-fit to "modernize/" 2015-08-31 13:17:43 +00:00
config-files.cpp [clang-tidy] Don't ignore default set of checks when a config file is found. 2015-02-05 14:50:17 +00:00
cppcoreguidelines-pro-bounds-pointer-arithmetic.cpp [clang-tidy] new check cppcoreguidelines-pro-bounds-pointer-arithmetic 2015-10-12 21:53:19 +00:00
cppcoreguidelines-pro-type-const-cast.cpp Fixing links and reformatting code; NFC. 2015-10-07 20:33:36 +00:00
cppcoreguidelines-pro-type-reinterpret-cast.cpp Fixing links and reformatting code; NFC. 2015-10-07 20:33:36 +00:00
cppcoreguidelines-pro-type-static-cast-downcast.cpp [clang-tidy] add check cppcoreguidelines-pro-type-static-cast-downcast 2015-10-12 20:46:53 +00:00
cppcoreguidelines-pro-type-union-access.cpp [clang-tidy] add check cppcoreguidelines-pro-type-union-access 2015-10-16 18:46:30 +00:00
deduplication.cpp [clang-tidy] Support initializer_list in google-explicit-constructor check 2014-11-27 11:11:47 +00:00
diagnostic.cpp [clang-tidy] Added missing check lines, made the checking stricter. 2015-09-30 13:32:42 +00:00
file-filter.cpp Tweak clang-tools-extra/test/clang-tidy/file-filter.cpp to pass on win32. 2015-08-20 15:04:39 +00:00
fix-errors.cpp [clang-tidy] Added -fix-errors option 2014-11-03 14:06:31 +00:00
fix.cpp [clang-tidy] Add an option to export suggested fixes into a file. 2014-09-04 10:31:23 +00:00
google-build-explicit-make-pair.cpp [clang-tidy] Renamed tests files to be closer to the check names. 2015-09-10 10:58:38 +00:00
google-explicit-constructor.cpp [clang-tidy] Use a python script instead of a shell script to run clang-tidy tests. 2015-08-20 17:58:07 +00:00
google-module.cpp [clang-tidy] Set google-readability-namespace-comments.ShortNamespaceLines to 10 2014-11-20 15:05:32 +00:00
google-namespaces.cpp [clang-tidy] Add namespaces checkers. 2014-07-16 14:16:56 +00:00
google-overloaded-unary-and.cpp [clang-tidy] Use a python script instead of a shell script to run clang-tidy tests. 2015-08-20 17:58:07 +00:00
google-readability-casting.c [clang-tidy] Use a python script instead of a shell script to run clang-tidy tests. 2015-08-20 17:58:07 +00:00
google-readability-casting.cpp [clang-tidy] Use a python script instead of a shell script to run clang-tidy tests. 2015-08-20 17:58:07 +00:00
google-readability-namespace-comments.cpp [clang-tidy] Use a python script instead of a shell script to run clang-tidy tests. 2015-08-20 17:58:07 +00:00
google-readability-todo.cpp [clang-tidy] Use a python script instead of a shell script to run clang-tidy tests. 2015-08-20 17:58:07 +00:00
google-runtime-int-std.cpp [clang-tidy] Make google-runtime-int configurable. 2015-09-16 14:36:22 +00:00
google-runtime-int.c [clang-tidy] google-runtime-int: Don't check C code. 2014-12-08 11:17:25 +00:00
google-runtime-int.cpp [clang-tidy] google-runtime-int: made the matcher more restricting, added a test for a false positive 2015-09-16 15:08:46 +00:00
google-runtime-member-string-references.cpp [clang-tidy] Renamed tests files to be closer to the check names. 2015-09-10 10:58:38 +00:00
google-runtime-memset-zero-length.cpp [clang-tidy] Renamed tests files to be closer to the check names. 2015-09-10 10:58:38 +00:00
line-filter.cpp [clang-tidy] Support initializer_list in google-explicit-constructor check 2014-11-27 11:11:47 +00:00
llvm-include-order.cpp Remove garbage. The issue was fixed in r246856. 2015-09-15 14:01:09 +00:00
llvm-twine-local.cpp [clang-tidy] Use a python script instead of a shell script to run clang-tidy tests. 2015-08-20 17:58:07 +00:00
macros.cpp [clang-tidy] Support initializer_list in google-explicit-constructor check 2014-11-27 11:11:47 +00:00
misc-argument-comment.cpp [clang-tidy] Renamed a test file to <check-name>.cpp. 2015-08-27 18:03:37 +00:00
misc-assert-side-effect.cpp [clang-tidy] misc-assert-side-effect: support assert macros defined through other macros 2015-08-31 14:47:14 +00:00
misc-assign-operator-signature.cpp Expose the clang-tidy misc-assign-operator-signature checker as cppcoreguidelines-c-copy-assignment-signature. 2015-10-13 15:24:33 +00:00
misc-bool-pointer-implicit-conversion.cpp [clang-tidy] Use a python script instead of a shell script to run clang-tidy tests. 2015-08-20 17:58:07 +00:00
misc-inaccurate-erase.cpp [clang-tidy] Use a python script instead of a shell script to run clang-tidy tests. 2015-08-20 17:58:07 +00:00
misc-inefficient-algorithm.cpp [clang-tidy] Use a python script instead of a shell script to run clang-tidy tests. 2015-08-20 17:58:07 +00:00
misc-macro-parentheses.cpp [clang-tidy] Use a python script instead of a shell script to run clang-tidy tests. 2015-08-20 17:58:07 +00:00
misc-move-constructor-init.cpp Improved the misc-move-constructor-init check to identify arguments that are passed by value but copy assigned to class data members when the non-deleted move constructor is a better fit. 2015-10-06 16:27:03 +00:00
misc-new-delete-overloads-sized-dealloc.cpp Silencing bot failures a more creative and definitive way. 2015-09-29 13:38:00 +00:00
misc-new-delete-overloads.cpp Some of the build bots are unhappy about the overload of the global operator new() because it was accidentally marked noexcept instead of noexcept(false). This should correct those bots. 2015-09-29 14:26:00 +00:00
misc-noexcept-move-constructor.cpp [clang-tidy] Use a python script instead of a shell script to run clang-tidy tests. 2015-08-20 17:58:07 +00:00
misc-non-copyable-objects.c Adding a checker (misc-non-copyable-objects) that detects situations where a non-copyable C type is being dereferenced, such as FILE or pthread_mutex_t. Corresponds to the CERT C++ secure coding rule: https://www.securecoding.cert.org/confluence/display/c/FIO38-C.+Do+not+copy+a+FILE+object 2015-09-30 14:09:38 +00:00
misc-non-copyable-objects.cpp Adding a checker (misc-non-copyable-objects) that detects situations where a non-copyable C type is being dereferenced, such as FILE or pthread_mutex_t. Corresponds to the CERT C++ secure coding rule: https://www.securecoding.cert.org/confluence/display/c/FIO38-C.+Do+not+copy+a+FILE+object 2015-09-30 14:09:38 +00:00
misc-repeated-side-effects-in-macro.c [clang-tidy] Use a python script instead of a shell script to run clang-tidy tests. 2015-08-20 17:58:07 +00:00
misc-sizeof-container.cpp [clang-tidy] misc-sizeof-container: remove fix-it hints 2015-09-14 16:51:52 +00:00
misc-static-assert.c Allow the static assert clang-tidy checker to run over C code. 2015-08-31 21:54:42 +00:00
misc-static-assert.cpp [clang-tidy] Use a python script instead of a shell script to run clang-tidy tests. 2015-08-20 17:58:07 +00:00
misc-swapped-arguments.cpp [clang-tidy] Use a python script instead of a shell script to run clang-tidy tests. 2015-08-20 17:58:07 +00:00
misc-throw-by-value-catch-by-reference.cpp Explicitly enable -fcxx-exceptions for this test to appease Windows build bots. 2015-10-09 21:15:00 +00:00
misc-undelegated-constructor-cxx98.cpp Disable clang-tidy misc checkers when not compiling in C++ mode. Many of the checkers do not require additional testing as the tests will not compile for other languages or modes, or the checkers would never match a valid construct. 2015-08-28 19:27:19 +00:00
misc-undelegated-constructor.cpp [clang-tidy] Use a python script instead of a shell script to run clang-tidy tests. 2015-08-20 17:58:07 +00:00
misc-uniqueptr-reset-release.cpp [clang-tidy] Use a python script instead of a shell script to run clang-tidy tests. 2015-08-20 17:58:07 +00:00
misc-unused-alias-decls.cpp [clang-tidy] Use a python script instead of a shell script to run clang-tidy tests. 2015-08-20 17:58:07 +00:00
misc-unused-parameters.c [clang-tidy] Use a python script instead of a shell script to run clang-tidy tests. 2015-08-20 17:58:07 +00:00
misc-unused-parameters.cpp misc-unused-parameter: Ignore lambda static invokers. 2015-09-22 09:20:20 +00:00
misc-unused-raii.cpp [clang-tidy] Use a python script instead of a shell script to run clang-tidy tests. 2015-08-20 17:58:07 +00:00
modernize-loop-convert-basic.cpp Document a bug in loop-convert and fix one of its subcases. 2015-10-05 11:15:39 +00:00
modernize-loop-convert-camelback.cpp Add NamingStyle option to modernize-loop-convert. 2015-09-24 17:02:19 +00:00
modernize-loop-convert-extra.cpp Prevent loop-convert from leaving empty lines after removing an alias declaration. 2015-10-01 13:08:21 +00:00
modernize-loop-convert-lowercase.cpp Handle trailing underscores on modernize-loop-convert variable namer. 2015-10-02 13:20:11 +00:00
modernize-loop-convert-negative.cpp Add NamingStyle option to modernize-loop-convert. 2015-09-24 17:02:19 +00:00
modernize-loop-convert-uppercase.cpp Handle trailing underscores on modernize-loop-convert variable namer. 2015-10-02 13:20:11 +00:00
modernize-loop-convert.c Disable several more clang-tidy modernize checkers when not compiling in C++ mode. Loop conversion would make recommendations for C code, so added a test to ensure that does not happen. The pass by value, use auto and replace auto_ptr checkers would not make recommendations for C code, and are disabled for performance reasons, but do not require an extra test. 2015-08-28 17:58:10 +00:00
modernize-make-unique.cpp Use __SIZE_TYPE__ to fix buildbot failures. 2015-10-14 10:30:32 +00:00
modernize-pass-by-value.cpp [clang-tidy] Use a python script instead of a shell script to run clang-tidy tests. 2015-08-20 17:58:07 +00:00
modernize-replace-auto-ptr.cpp Add replace-auto_ptr check. 2015-08-25 13:03:43 +00:00
modernize-shrink-to-fit.cpp [clang-tidy] Move misc-use-override and readability-shrink-to-fit to "modernize/" 2015-08-31 13:17:43 +00:00
modernize-use-auto-iterator.cpp [clang-tidy] Migrate UseAuto from clang-modernize to clang-tidy. 2015-08-21 15:08:51 +00:00
modernize-use-auto-new.cpp Prevent modernize-use-auto from emitting a warning when 'auto' was already being used. 2015-10-14 09:29:55 +00:00
modernize-use-default.cpp Add modernize-use-default check to clang-tidy. 2015-10-21 12:58:15 +00:00
modernize-use-nullptr-basic.cpp [clang-tidy] Documented the reason to run the test in C++98 mode. 2015-08-27 23:43:39 +00:00
modernize-use-nullptr.c Reapplying r246209, which exposed language options to the checkers. This time disable UseNullptrCheck when not compiling in C++ mode, but still allow in C++11 mode since it's likely the user wishes to modernize their code. 2015-08-28 13:20:46 +00:00
modernize-use-nullptr.cpp Fix bug in modernize-use-nullptr. 2015-10-05 08:40:13 +00:00
modernize-use-override-cxx98.cpp [clang-tidy] Move misc-use-override and readability-shrink-to-fit to "modernize/" 2015-08-31 13:17:43 +00:00
modernize-use-override.cpp [clang-tidy] Move misc-use-override and readability-shrink-to-fit to "modernize/" 2015-08-31 13:17:43 +00:00
nolint.cpp [clang-tidy] Support initializer_list in google-explicit-constructor check 2014-11-27 11:11:47 +00:00
overlapping.cpp Replacements in different files do not overlap. 2015-10-16 16:15:27 +00:00
readability-braces-around-statements-few-lines.cpp [clang-tidy] Use a python script instead of a shell script to run clang-tidy tests. 2015-08-20 17:58:07 +00:00
readability-braces-around-statements-same-line.cpp [clang-tidy] Use a python script instead of a shell script to run clang-tidy tests. 2015-08-20 17:58:07 +00:00
readability-braces-around-statements-single-line.cpp [clang-tidy] Use a python script instead of a shell script to run clang-tidy tests. 2015-08-20 17:58:07 +00:00
readability-braces-around-statements.cpp [clang-tidy] Fix an assertion in the readability-braces-around-statements check. 2015-09-30 12:48:42 +00:00
readability-container-size-empty.cpp [clang-tidy] Use a python script instead of a shell script to run clang-tidy tests. 2015-08-20 17:58:07 +00:00
readability-else-after-return.cpp [clang-tidy] Use a python script instead of a shell script to run clang-tidy tests. 2015-08-20 17:58:07 +00:00
readability-function-size.cpp [clang-tidy] Use a python script instead of a shell script to run clang-tidy tests. 2015-08-20 17:58:07 +00:00
readability-identifier-naming.cpp [clang-tidy] Implement FixitHints for identifier references in IdentifierNamingCheck 2015-10-01 09:19:40 +00:00
readability-inconsistent-declaration-parameter-name.cpp clang-tidy/readability-inconsistent-declaration-parameter-name.cpp: Appease MS-incompatibility [-fno-delayed-template-parsing] 2015-09-11 08:16:22 +00:00
readability-named-parameter.cpp [clang-tidy] Use a python script instead of a shell script to run clang-tidy tests. 2015-08-20 17:58:07 +00:00
readability-redundant-smartptr-get.cpp [clang-tidy] Use a python script instead of a shell script to run clang-tidy tests. 2015-08-20 17:58:07 +00:00
readability-redundant-string-cstr.cpp [clang-tidy] Use a python script instead of a shell script to run clang-tidy tests. 2015-08-20 17:58:07 +00:00
readability-simplify-bool-expr-chained-conditional-assignment.cpp [clang-tidy] Use a python script instead of a shell script to run clang-tidy tests. 2015-08-20 17:58:07 +00:00
readability-simplify-bool-expr-chained-conditional-return.cpp [clang-tidy] Use a python script instead of a shell script to run clang-tidy tests. 2015-08-20 17:58:07 +00:00
readability-simplify-bool-expr.cpp [clang-tidy] Use a python script instead of a shell script to run clang-tidy tests. 2015-08-20 17:58:07 +00:00
readability-uniqueptr-delete-release.cpp Added check uniqueptr-delete-release to replace "delete x.release()" with "x = nullptr" 2015-10-19 21:49:51 +00:00
select-checks.cpp [clang-tidy] Move the missing namespace comment warnings to the closing brace 2014-11-17 17:32:32 +00:00
serialize-diagnostics.cpp [clang-tidy] Make a test independent of the default check set. 2014-12-03 13:48:46 +00:00
static-analyzer-config.cpp [clang-tidy] Static Analyzer checker configuration options pass-through. 2015-03-11 17:25:22 +00:00
static-analyzer.cpp Change the behavior of clang-tidy -checks=, remove -disable-checks. 2014-05-15 14:27:36 +00:00
temporaries.cpp Change the behavior of clang-tidy -checks=, remove -disable-checks. 2014-05-15 14:27:36 +00:00
validate-check-names.cpp [clang-tidy] Allow use of -list-checks option without need to pass source files. 2015-08-17 10:03:27 +00:00