[PATCH] D24784: [change-namespace] fix name qualifiers in UsingShadowDecl and NestedNameSpecifier.
Haojian Wu via cfe-commits
cfe-commits at lists.llvm.org
Wed Sep 21 03:20:49 PDT 2016
hokein added a comment.
Looks almost good. A few comments.
================
Comment at: change-namespace/ChangeNamespace.cpp:467
@@ +466,3 @@
+ const NamedDecl *TargetDecl =
+ UsingDeclaration->shadow_begin()->getTargetDecl();
+ std::string TargetDeclName = TargetDecl->getQualifiedNameAsString();
----------------
It is not always accurate to use the first using-decls. It's fine now since don't have better solution for this. Add a `FIXME`.
================
Comment at: unittests/change-namespace/ChangeNamespaceTests.cpp:243
@@ +242,3 @@
+ "typedef nc::SAME IDENTICAL;\n"
+ "void f(nd::SAME Same) {}\n"
+ "} // namespace nb\n"
----------------
How about the case `void f2(SAME Same){}`? Is it changed to `::na::nc::SAME` too? Make sense to add it to the test.
BTW, does the patch cover using alias ("using A = x::y::z;") case? If yes, also add to the test.
https://reviews.llvm.org/D24784
More information about the cfe-commits
mailing list