[clang] [SSAF][Extractor][Do not merge] Extract operator new/delete overload entities that shall retain their types (PR #206600)

Balázs Benics via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 30 04:16:45 PDT 2026


================
@@ -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


More information about the cfe-commits mailing list