a.sidorin accepted this revision.
a.sidorin added a comment.
This revision is now accepted and ready to land.

Looks good!



================
Comment at: lib/AST/ASTImporter.cpp:2650
+  for (const auto *A : D->attrs())
+    ToIndirectField->addAttr(Importer.Import(const_cast<Attr *>(A)));
 
----------------
r.stahl wrote:
> a.sidorin wrote:
> > Could we just remove 'const' qualifier from `A` to avoid `const_cast`? 
> > (Same below)
> I made the interface const instead.
Yes, that's even better!


================
Comment at: lib/AST/ASTImporter.cpp:4724
   SmallVector<const Attr *, 1> ToAttrs(FromAttrs.size());
-  ASTContext &_ToContext = Importer.getToContext();
   std::transform(FromAttrs.begin(), FromAttrs.end(), ToAttrs.begin(),
+    [this](const Attr *A) -> const Attr * {
----------------
a.sidorin wrote:
> Could we use ImportArrayChecked instead?
We can use just `ImportArrayChecked(FromAttrs, ToAttrs.begin())`. But this is 
more a hint than a requirement.


https://reviews.llvm.org/D46115



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

Reply via email to