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 | 8393cb01913265af3fab80e8e93c3ea4e3eed6c9 (patch) | |
| tree | e2c87eb696e21b12b581addc86997e68f806f4ba /clang-tools-extra/change-namespace/ChangeNamespace.cpp | |
| parent | 938f5164246680722ca22981677f2cb385666d0a (diff) | |
| download | bcm5719-llvm-8393cb01913265af3fab80e8e93c3ea4e3eed6c9.tar.gz bcm5719-llvm-8393cb01913265af3fab80e8e93c3ea4e3eed6c9.zip | |
[change-namespace] fix namespace specifiers of template arguments.
llvm-svn: 285549
Diffstat (limited to 'clang-tools-extra/change-namespace/ChangeNamespace.cpp')
| -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"), |

