[PATCH] D27181: [ASTImporter] Support for importing UsingDecl and UsingShadowDecl

Sean Callanan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 29 09:46:03 PST 2016


spyffe added a comment.

Looks good, but I have a concern about the underlying branch's apparently inconsistent initialization of `DeclarationNameInfo`.  Aleksei, could you clarify how that code works?  Should we have a helper function so we don't have to carefully repeat this pattern everywhere?



================
Comment at: lib/AST/ASTImporter.cpp:4305
+  DeclarationNameInfo NameInfo(Name, Importer.Import(D->getNameInfo().getLoc()));
+  ImportDeclarationNameLoc(D->getNameInfo(), NameInfo);
+
----------------
I've seen this pattern before, in [[ https://reviews.llvm.org/D27033 | D20733 ]], at ASTImporter.cpp:6488:
```
  DeclarationNameInfo NameInfo(E->getName(), E->getNameLoc());
  ImportDeclarationNameLoc(E->getNameInfo(), NameInfo);
```
That code didn't do the `Import` during the initialization of the `DeclarationNameInfo`.  Is either of these incorrect?


https://reviews.llvm.org/D27181





More information about the cfe-commits mailing list