a.sidorin marked 2 inline comments as done.
a.sidorin added inline comments.

Comment at: lib/AST/ASTImporter.cpp:4296
   // Create the declaration that is being templated.
-  SourceLocation StartLoc = Importer.Import(DTemplated->getLocStart());
-  SourceLocation IdLoc = Importer.Import(DTemplated->getLocation());
-  TypeSourceInfo *TInfo = Importer.Import(DTemplated->getTypeSourceInfo());
-  VarDecl *D2Templated = VarDecl::Create(Importer.getToContext(), DC, StartLoc,
-                                         IdLoc, Name.getAsIdentifierInfo(), T,
-                                         TInfo, DTemplated->getStorageClass());
-  D2Templated->setAccess(DTemplated->getAccess());
-  D2Templated->setLexicalDeclContext(LexicalDC);
-  // Importer.Imported(DTemplated, D2Templated);
-  // LexicalDC->addDeclInternal(D2Templated);
-  // Merge the initializer.
-  if (ImportDefinition(DTemplated, D2Templated))
+  VarDecl *ToTemplated = 
+  if (!ToTemplated)
xazax.hun wrote:
> `auto *` to not repeat type.
I usually prefer to keep the type if it doesn't give a large space win because 
it hurts readability a bit. From `VarDecl *`, we can instantly find the type; 
for `auto`, we have to look forward. (Yes, VarTemplatePartialSpecializationDecl 
has to be replaced immediately :) ).
Other issue is that QtCreator I use for development still doesn't have an 
autocompletion for auto types. However, LLVM says: "do use auto with 
initializers like cast<Foo>(...)", so I'll change this.

  rC Clang


cfe-commits mailing list

Reply via email to