================
@@ -109,24 +109,28 @@ void extractAndAddSummaries(TUSummaryExtractor &Extractor,
       Contributors;
   findContributors(Ctx, Contributors);
   for (const auto &[Cano, Decls] : Contributors) {
+    assert(Decls.size() > 0 && !Decls[0]->isImplicit() &&
+           "guaranteed by 'findContributors'");
+    const NamedDecl *Rep = Cano->isImplicit() ? Decls[0] : Cano;
----------------
steakhal wrote:

I was scratching my head exactly on this line when I noticed you had a comment.
I wish we had a similar comment in code for this. I didn't know we can't create 
entity IDs for implicit canonical decls.

This prompts me: Why might be the canonical decl implicit?
How does this change solve this issue? In other words, what guarantees that 
`Decls[0]` is not implicit for example?

https://github.com/llvm/llvm-project/pull/206600
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to