[PATCH] D26423: [clang-move] Support template class.
Eric Liu via cfe-commits
cfe-commits at lists.llvm.org
Tue Nov 8 16:21:50 PST 2016
ioeric added a comment.
Nice!
First round of comments.
================
Comment at: clang-move/ClangMove.cpp:414
RemovedDecls.push_back(MovedDecls.back());
+ if (const auto *FTD = CMD->getDescribedFunctionTemplate()) {
+ UnremovedDeclsInOldHeader.erase(FTD);
----------------
Some comments here would be appreciated.
Also nit: no braces.
================
Comment at: clang-move/ClangMove.cpp:427
Result.Nodes.getNodeAs<clang::CXXRecordDecl>("moved_class")) {
- MovedDecls.emplace_back(class_decl, &Result.Context->getSourceManager());
+ if (const auto * TC = CD->getDescribedClassTemplate()) {
+ MovedDecls.emplace_back(TC, &Result.Context->getSourceManager());
----------------
Same as above. Comments and braces.
================
Comment at: test/clang-move/move-template-class.cpp:20
+//
+// CHECK-NEW-TEST-H-CASE1: #ifndef TEMPLATE_CLASS_TEST_H // comment 1
+// CHECK-NEW-TEST-H-CASE1: #define TEMPLATE_CLASS_TEST_H
----------------
Not directly related, but we might want to start thinking about appropriate code formatting like spaces between decls. Code jamming together is not pretty...
https://reviews.llvm.org/D26423
More information about the cfe-commits
mailing list