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 @@ -272,6 +272,11 @@ } if (const auto *Decl = Result.Nodes.getNodeAs("decl")) { + // Fix using namespace declarations. + if (const auto *UsingNS = dyn_cast(Decl)) + addUsage(NamingCheckFailures, UsingNS->getNominatedNamespaceAsWritten(), + UsingNS->getIdentLocation()); + if (!Decl->getIdentifier() || Decl->getName().empty() || Decl->isImplicit()) return; 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 @@ -527,3 +527,8 @@ // CHECK-FIXES: {{^}} int * const lc_PointerB = nullptr;{{$}} } +using namespace FOO_NS; +// CHECK-FIXES: {{^}}using namespace foo_ns; + +using namespace FOO_NS::InlineNamespace; +// CHECK-FIXES: {{^}}using namespace foo_ns::inline_namespace;