a_sidorin added a comment.

Hi Gabor,
The patch looks OK overall but I have some comments inline.



================
Comment at: lib/AST/ASTImporter.cpp:4966
 // it has any definition in the redecl chain.
-static ClassTemplateDecl *getDefinition(ClassTemplateDecl *D) {
-  CXXRecordDecl *ToTemplatedDef = D->getTemplatedDecl()->getDefinition();
+template <typename T> static auto getDefinition(T *D) -> T * {
+  auto *ToTemplatedDef = D->getTemplatedDecl()->getDefinition();
----------------
We should point that this function is for TemplateDecls only somehow. But we 
can't just pass TemplateDecl as the parameter due to loss of the actual return 
type. Maybewe should rename this function into "getTemplateDefinition()"?


================
Comment at: lib/AST/ASTImporter.cpp:5563
+          // TODO: handle conflicting names
+        } // linkage
+      }   // template
----------------
We don't usually put such comments after control flow statements. If they are 
really needed, it is a good sign that a function must be split, and it's better 
to leave a FIXME for this (or do the split).


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58494/new/

https://reviews.llvm.org/D58494



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to