summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/change-namespace/ChangeNamespace.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/change-namespace/ChangeNamespace.cpp')
-rw-r--r--clang-tools-extra/change-namespace/ChangeNamespace.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/clang-tools-extra/change-namespace/ChangeNamespace.cpp b/clang-tools-extra/change-namespace/ChangeNamespace.cpp
index 40eb36ba4ef..4157e4df4ca 100644
--- a/clang-tools-extra/change-namespace/ChangeNamespace.cpp
+++ b/clang-tools-extra/change-namespace/ChangeNamespace.cpp
@@ -272,13 +272,15 @@ void ChangeNamespaceTool::registerMatchers(ast_matchers::MatchFinder *Finder) {
allOf(IsInMovedNs, unless(cxxRecordDecl(unless(isDefinition())))))));
// Match TypeLocs on the declaration. Carefully match only the outermost
- // TypeLoc that's directly linked to the old class and don't handle nested
- // name specifier locs.
+ // TypeLoc and template specialization arguments (which are not outermost)
+ // that are directly linked to types matching `DeclMatcher`. Nested name
+ // specifier locs are handled separately below.
Finder->addMatcher(
typeLoc(IsInMovedNs,
loc(qualType(hasDeclaration(DeclMatcher.bind("from_decl")))),
- unless(anyOf(hasParent(typeLoc(
- loc(qualType(hasDeclaration(DeclMatcher))))),
+ unless(anyOf(hasParent(typeLoc(loc(qualType(
+ allOf(hasDeclaration(DeclMatcher),
+ unless(templateSpecializationType())))))),
hasParent(nestedNameSpecifierLoc()))),
hasAncestor(decl().bind("dc")))
.bind("type"),
OpenPOWER on IntegriCloud