diff --git a/clang-tools-extra/clang-tidy/utils/RenamerClangTidyCheck.cpp b/clang-tools-extra/clang-tidy/utils/RenamerClangTidyCheck.cpp --- a/clang-tools-extra/clang-tidy/utils/RenamerClangTidyCheck.cpp +++ b/clang-tools-extra/clang-tidy/utils/RenamerClangTidyCheck.cpp @@ -203,14 +203,15 @@ } if (const auto *Loc = Result.Nodes.getNodeAs("typeLoc")) { + UnqualTypeLoc Unqual = Loc->getUnqualifiedLoc(); NamedDecl *Decl = nullptr; - if (const auto &Ref = Loc->getAs()) + if (const auto &Ref = Unqual.getAs()) Decl = Ref.getDecl(); - else if (const auto &Ref = Loc->getAs()) + else if (const auto &Ref = Unqual.getAs()) Decl = Ref.getDecl(); - else if (const auto &Ref = Loc->getAs()) + else if (const auto &Ref = Unqual.getAs()) Decl = Ref.getDecl(); - else if (const auto &Ref = Loc->getAs()) + else if (const auto &Ref = Unqual.getAs()) Decl = Ref.getDecl(); // further TypeLocs handled below diff --git a/clang-tools-extra/test/clang-tidy/checkers/bugprone-reserved-identifier-invert.cpp b/clang-tools-extra/test/clang-tidy/checkers/bugprone-reserved-identifier-invert.cpp --- a/clang-tools-extra/test/clang-tidy/checkers/bugprone-reserved-identifier-invert.cpp +++ b/clang-tools-extra/test/clang-tidy/checkers/bugprone-reserved-identifier-invert.cpp @@ -57,7 +57,7 @@ inline reference_wrapper cref(const Up &u) noexcept { // CHECK-MESSAGES: :[[@LINE-1]]:16: warning: declaration uses identifier 'u', which is not a reserved identifier [bugprone-reserved-identifier] - // CHECK-FIXES: {{^}}cref(const Up &__u) noexcept {{{$}} + // CHECK-FIXES: {{^}}cref(const _Up &__u) noexcept {{{$}} return reference_wrapper(u); } diff --git a/clang-tools-extra/test/clang-tidy/checkers/readability-identifier-naming.cpp b/clang-tools-extra/test/clang-tidy/checkers/readability-identifier-naming.cpp --- a/clang-tools-extra/test/clang-tidy/checkers/readability-identifier-naming.cpp +++ b/clang-tools-extra/test/clang-tidy/checkers/readability-identifier-naming.cpp @@ -532,3 +532,16 @@ using namespace FOO_NS::InlineNamespace; // CHECK-FIXES: {{^}}using namespace foo_ns::inline_namespace; + +void QualifiedTypeLocTest(THIS___Structure); +// CHECK-FIXES: {{^}}void QualifiedTypeLocTest(this_structure);{{$}} +void QualifiedTypeLocTest(THIS___Structure &); +// CHECK-FIXES: {{^}}void QualifiedTypeLocTest(this_structure &);{{$}} +void QualifiedTypeLocTest(THIS___Structure &&); +// CHECK-FIXES: {{^}}void QualifiedTypeLocTest(this_structure &&);{{$}} +void QualifiedTypeLocTest(const THIS___Structure); +// CHECK-FIXES: {{^}}void QualifiedTypeLocTest(const this_structure);{{$}} +void QualifiedTypeLocTest(const THIS___Structure &); +// CHECK-FIXES: {{^}}void QualifiedTypeLocTest(const this_structure &);{{$}} +void QualifiedTypeLocTest(volatile THIS___Structure &); +// CHECK-FIXES: {{^}}void QualifiedTypeLocTest(volatile this_structure &);{{$}}