llvm-project/clang-tools-extra/clang-tidy
Sockke a7f8aea714 [clang-tidy] Fix wrong FixIt in performance-move-const-arg
There are incorrect Fixit and missing warnings:
case :
A trivially-copyable object wrapped by std::move is passed to the function with rvalue reference parameters. Removing std::move will cause compilation errors.
```
void showInt(int&&) {}
void testInt() {
    int a = 10;
    // expect: warning + nofix
    showInt(std::move(a));  // showInt(a) <--- wrong fix
}

struct Tmp {};
void showTmp(Tmp&&) {}
void testTmp() {
    Tmp t;
    // expect: warning + nofix
    showTmp(std::move(t));  // showTmp(t) <--- wrong fix
}
```

Reviewed By: aaron.ballman, Quuxplusone

Differential Revision: https://reviews.llvm.org/D107450
2022-01-21 14:23:52 +08:00
..
abseil [NFC] Fix endif comments to match with include guard 2022-01-07 15:52:59 +08:00
altera [clang-tidy] Fix crashing altera-struct-pack-align on invalid RecordDecls 2021-11-29 09:56:43 +01:00
android Use StringRef::contains (NFC) 2021-12-24 22:05:34 -08:00
boost [openmp] Add missing dependencies for OMP.h.inc after d90443b 2020-06-23 11:48:04 -04:00
bugprone [clang-tidy] Update bugprone-stringview-nullptr to consistently prefer the empty string when passing arguments to constructors/functions 2022-01-20 18:08:40 -05:00
cert [NFC] Fix endif comments to match with include guard 2022-01-07 15:52:59 +08:00
concurrency [clang-tidy] Add new check 'concurrency-thread-canceltype-asynchronous' and alias 'cert-pos47-c'. 2021-02-22 12:42:20 +01:00
cppcoreguidelines [clang-tidy] Narrow cppguidelines-macro-usage to actual constants 2022-01-19 12:28:22 -07:00
darwin [openmp] Add missing dependencies for OMP.h.inc after d90443b 2020-06-23 11:48:04 -04:00
fuchsia Fix false positives in `fuchsia-trailing-return` check involving deduction guides 2021-12-01 15:28:01 -05:00
google Reland "[AST] Add UsingType: a sugar type for types found via UsingDecl" 2021-12-20 18:03:15 +01:00
hicpp [clang-tidy] Applied clang-tidy fixes. NFC 2021-01-29 01:01:19 +01:00
linuxkernel [openmp] Add missing dependencies for OMP.h.inc after d90443b 2020-06-23 11:48:04 -04:00
llvm [clang-tidy] Fix llvm-header-guard so that it works with Windows paths 2021-11-10 18:35:57 +13:00
llvmlibc Remove redundant return and continue statements (NFC) 2021-12-24 23:17:54 -08:00
misc [clang-tidy] Fix false positives involving type aliases in `misc-unconventional-assign-operator` check 2022-01-17 21:16:17 +01:00
modernize [AST] Fix the incorrect auto-keyword loc for constrained auto type loc. 2022-01-19 14:18:38 +01:00
mpi [clang-tidy][NFC] replace some redundant std::string creations 2022-01-19 18:36:35 +00:00
objc [clang-tidy][objc] Finds and fixes improper usages of XCTAssertEquals and XCTAssertNotEquals. 2021-12-02 18:32:16 -05:00
openmp [clang-tidy][NFC] Remove unnecessary includes throughout clang-tidy header files 2020-06-29 16:05:52 +01:00
performance [clang-tidy] Fix wrong FixIt in performance-move-const-arg 2022-01-21 14:23:52 +08:00
plugin [clang-tidy] Fix lint warnings in clang-tidy source code (NFC) 2021-11-02 20:14:25 +13:00
portability [clang-tidy][NFC] Tweak some generation of diag messages 2021-02-26 19:10:25 +00:00
readability [clang-tidy][NFC] replace some redundant std::string creations 2022-01-19 18:36:35 +00:00
tool Revert "[cmake] Use `GNUInstallDirs` to support custom installation dirs." 2022-01-16 05:48:30 +00:00
utils [clang-tidy] Include constructor initializers in `bugprone-exception-escape` check 2022-01-21 00:53:57 +01:00
zircon Remove references to the ast_type_traits namespace 2020-12-11 00:58:46 +01:00
CMakeLists.txt Revert "[cmake] Use `GNUInstallDirs` to support custom installation dirs." 2022-01-16 05:48:30 +00:00
ClangTidy.cpp [clang-tidy] Fix lint warnings in clang-tidy source code (NFC) 2021-11-02 20:14:25 +13:00
ClangTidy.h [clang-tidy] Fix lint warnings in clang-tidy source code (NFC) 2021-11-02 20:14:25 +13:00
ClangTidyCheck.cpp [clang-tidy] Add new case type to check variables with Hungarian notation 2021-08-01 15:22:17 -07:00
ClangTidyCheck.h [clang-tidy] Add new case type to check variables with Hungarian notation 2021-08-01 15:22:17 -07:00
ClangTidyDiagnosticConsumer.cpp [clangd][clang-tidy] Remove uses of `std::vector<bool>` 2022-01-18 17:59:40 +01:00
ClangTidyDiagnosticConsumer.h Resolve -Wdocumentation warning in ClangTidyDiagnosticConsumer (NFC) 2021-12-23 10:25:05 +13:00
ClangTidyForceLinker.h [clang-tidy] add concurrency module 2020-11-30 12:27:17 +03:00
ClangTidyModule.cpp [clang-tidy][NFC] Use StringMap for ClangTidyCheckFactories::FacoryMap 2020-07-30 22:57:33 +01:00
ClangTidyModule.h [clang-tidy][NFC] Remove unnecessary headers 2020-12-28 15:01:51 +00:00
ClangTidyModuleRegistry.h
ClangTidyOptions.cpp [clang-tidy] Applied clang-tidy fixes. NFC 2021-01-29 01:01:19 +01:00
ClangTidyOptions.h [clang-tidy] Fix lint warnings in clang-tidy source code (NFC) 2021-11-02 20:14:25 +13:00
ClangTidyProfiling.cpp [clang-tidy][NFC] Remove unnecessary headers 2020-12-28 15:01:51 +00:00
ClangTidyProfiling.h [clang-tidy][NFC] Remove unnecessary includes throughout clang-tidy header files 2020-06-29 16:05:52 +01:00
ExpandModularHeadersPPCallbacks.cpp [clang] Let PPCallbacks::PragmaWarning() pass specifier as enum instead of string 2021-09-28 19:47:27 -04:00
ExpandModularHeadersPPCallbacks.h [clang] Let PPCallbacks::PragmaWarning() pass specifier as enum instead of string 2021-09-28 19:47:27 -04:00
GlobList.cpp [clang-tidy][NFC] Move CachedGlobList to GlobList.h 2021-12-04 08:50:49 +00:00
GlobList.h [clang-tidy][NFC] Move CachedGlobList to GlobList.h 2021-12-04 08:50:49 +00:00
add_new_check.py [clang-tidy] Force LF newlines when writing files 2022-01-18 09:39:42 -07:00
clang-tidy-config.h.cmake Add an explicit toggle for the static analyzer in clang-tidy 2020-09-10 10:48:17 -04:00
rename_check.py Fix python 2-vs-3 issues in add_new_check.py and rename_check.py 2021-09-11 09:52:50 +02:00