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

Ziqing Luo via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 30 12:46:07 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;
----------------
ziqingluo-90 wrote:

> Why might be the canonical decl implicit
Operator new/delete overloads have implicit canonical decls, which I assume is inserted by the compiler.

> what guarantees that Decls[0] is not implicit for example?
The `ContributorFinder` skips implicit code so all the `Decl`s it finds is non-implicit.

https://github.com/llvm/llvm-project/pull/206600


More information about the cfe-commits mailing list