[PATCH] D53655: [ASTImporter] Fix redecl chain of classes and class templates

Gabor Marton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 22 08:51:49 PST 2018


martong marked 3 inline comments as done.
martong added inline comments.


================
Comment at: lib/AST/DeclBase.cpp:1469
         assert(Pos != Map->end() && "no lookup entry for decl");
-        if (Pos->second.getAsVector() || Pos->second.getAsDecl() == ND)
+        // Remove the decl only if it is contained.
+        if ((Pos->second.getAsVector() && Pos->second.containsInVector(ND)) ||
----------------
Szelethus wrote:
> balazske wrote:
> > martong wrote:
> > > Szelethus wrote:
> > > > Contained in?
> > > Indeed, `containedInVector` sounds better, so I renamed.
> > For me, `containsInVector` is the better name, or `hasInVector` ("contains" is already used at other places but not "contained" and it sounds like it is not contained any more).
> Sorry about the confusion, my inline was only about the comment above it, that it isn't obvious enough that //what// decl is contained in. But after taking a second look, it's very clear that only `Map` is mutated in this context, so I don't insist on any modification :)
Okay, so I just reverted the name change.


Repository:
  rC Clang

https://reviews.llvm.org/D53655





More information about the cfe-commits mailing list