llvm-project/clang-tools-extra/clang-tidy
Nathan James 7693a9b931 [clang-tidy] Fix RenamerClangTidy handling qualified TypeLocs
Summary:
Previously if a type was accessed with a qualifier, RenamerClangTidy wouldn't rename the TypeLoc, this patch addresses this shortfall by trying to find the Unqualified TypeLoc first. Also fixed a broken test case that was dependent on this broken behaviour.

Example:
```
struct a{};

void foo(const a&);
void foo(a&);
void foo(a);
void foo(a&&);
void foo(const a);
```
exec `-checks=readability-identifier-naming --config="{CheckOptions: [{key: readability-identifier-naming.StructCase, value: CamelCase}]}" -fix`
Current Behaviour:
```
struct A{};

void foo(const a&);
void foo(A&);
void foo(A);
void foo(A&&);
void foo(const a);
```
Proposed new behaviour:
```
struct A{};

void foo(const A&);
void foo(A&);
void foo(A);
void foo(A&&);
void foo(const A);
```

Reviewers: aaron.ballman, gribozavr2, alexfh

Reviewed By: aaron.ballman

Subscribers: xazax.hun, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D76549
2020-03-23 13:45:34 +00:00
..
abseil [clang-tidy] Update Abseil Duration Conversion check to find more cases. 2020-03-13 12:52:37 -04:00
android [clang-tidy] [NFC] Remove unnecessary matchers 2020-03-09 07:38:15 +00:00
boost [clang-tidy] Change checks to use new isLanguageVersionSupported restriction 2020-03-03 16:43:45 +00:00
bugprone [clang-tidy] Add spuriously-wake-up-functions check 2020-03-21 12:04:03 +01:00
cert [clang-tidy] Add spuriously-wake-up-functions check 2020-03-21 12:04:03 +01:00
cppcoreguidelines Add AllowMissingMoveFunctionsWhenCopyIsDeleted flag to cppcoreguidelines-special-member-functions 2020-03-16 08:14:48 -04:00
darwin [clang-tidy] Rename objc-avoid-spinlock check to darwin-avoid-spinlock 2019-10-01 21:18:40 +00:00
fuchsia [clang-tidy] Move fuchsia-restrict-system-includes to portability module for general use. 2020-03-10 13:33:06 -07:00
google [clang-tidy] Use ; as separator for HeaderFileExtensions 2020-03-09 11:32:44 -06:00
hicpp [NFC] use hasAnyOperatorName and hasAnyOverloadedOperatorName functions in clang-tidy matchers 2020-03-10 00:42:21 +00:00
linuxkernel [clang-tidy] Add a module for the Linux kernel. 2019-07-25 22:32:50 +00:00
llvm [clang-tidy] Use ; as separator for HeaderFileExtensions 2020-03-09 11:32:44 -06:00
llvmlibc [clang-tidy] Merge common code between llvmlibc-restrict-system-libc-headers and portability-restrict-system-includes 2020-03-20 15:53:05 -07:00
misc [clang-tidy] misc-unconventional-assign-operator suggest to use rvalue references in C++03 mode 2020-03-18 21:39:23 +00:00
modernize [AST] Correct the CXXOperatorCallExpr source range. 2020-03-16 16:51:10 +01:00
mpi Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
objc [clang-tidy] Change checks to use new isLanguageVersionSupported restriction 2020-03-03 16:43:45 +00:00
openmp [clang-tidy] Change checks to use new isLanguageVersionSupported restriction 2020-03-03 16:43:45 +00:00
performance [clang-tidy] Change checks to use new isLanguageVersionSupported restriction 2020-03-03 16:43:45 +00:00
plugin Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
portability [clang-tidy] Merge common code between llvmlibc-restrict-system-libc-headers and portability-restrict-system-includes 2020-03-20 15:53:05 -07:00
readability [NFC] use hasAnyOperatorName and hasAnyOverloadedOperatorName functions in clang-tidy matchers 2020-03-10 00:42:21 +00:00
tool Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
utils [clang-tidy] Fix RenamerClangTidy handling qualified TypeLocs 2020-03-23 13:45:34 +00:00
zircon [clang-tidy] Switch checks to #include "ClangTidyCheck.h" 2019-03-25 12:38:26 +00:00
CMakeLists.txt [clang-tidy] Add module for llvm-libc and restrict-system-libc-header-check. 2020-03-12 11:46:05 -07:00
ClangTidy.cpp [clang-tidy] Added virtual isLanguageVersionSupported to ClangTidyCheck 2020-02-28 13:05:05 +00:00
ClangTidy.h Remove \brief commands from doxygen comments. 2019-08-22 11:32:57 +00:00
ClangTidyCheck.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
ClangTidyCheck.h [clang-tidy] Added virtual isLanguageVersionSupported to ClangTidyCheck 2020-02-28 13:05:05 +00:00
ClangTidyDiagnosticConsumer.cpp Prune TargetInfo.h include from ParsedAttr.h, NFC 2020-03-11 20:47:11 -07:00
ClangTidyDiagnosticConsumer.h Prune TargetInfo.h include from ParsedAttr.h, NFC 2020-03-11 20:47:11 -07:00
ClangTidyForceLinker.h [clang-tidy][NFC] Add missing check group docs and order entries 2020-03-23 11:05:34 +01:00
ClangTidyModule.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
ClangTidyModule.h Return results by value from ClangTidyCheckFactories::createChecks 2019-09-26 13:55:01 +00:00
ClangTidyModuleRegistry.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ClangTidyOptions.cpp Remove \brief commands from doxygen comments. 2019-08-22 11:32:57 +00:00
ClangTidyOptions.h Remove \brief commands from doxygen comments. 2019-08-22 11:32:57 +00:00
ClangTidyProfiling.cpp Rename F_{None,Text,Append} to OF_{None,Text,Append}. NFC 2019-08-05 05:43:48 +00:00
ClangTidyProfiling.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ExpandModularHeadersPPCallbacks.cpp Prune TargetInfo.h include from ParsedAttr.h, NFC 2020-03-11 20:47:11 -07:00
ExpandModularHeadersPPCallbacks.h Avoid including FileManager.h from SourceManager.h 2020-03-11 13:53:12 -07:00
GlobList.cpp Refactor GlobList from an ad-hoc linked list to a vector 2019-08-27 10:56:13 +00:00
GlobList.h Refactor GlobList from an ad-hoc linked list to a vector 2019-08-27 10:56:13 +00:00
add_new_check.py [clang-tidy] rename_check.py: maintain alphabetical order in Renamed checks section 2020-02-20 17:31:08 +00:00
rename_check.py [clang-tidy] rename_check.py: maintain alphabetical order in Renamed checks section 2020-02-20 17:31:08 +00:00