diff options
author | Eric Liu <ioeric@google.com> | 2016-10-31 08:28:29 +0000 |
---|---|---|
committer | Eric Liu <ioeric@google.com> | 2016-10-31 08:28:29 +0000 |
commit | e279567d650da6564bc5d384bc3d0b86754181c8 (patch) | |
tree | b76eb12fe9246dfa8da6bd32b6cd969a84d0f071 /clang-tools-extra/change-namespace | |
parent | 12d41896910c0b1a4f7eedac206915e2c541bf36 (diff) |
[change-namespace] fix namespace specifiers of template arguments.
Diffstat (limited to 'clang-tools-extra/change-namespace')
-rw-r--r-- | clang-tools-extra/change-namespace/ChangeNamespace.cpp | 10 |
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"), |