[clang] [SSAF] Let UnsafeBufferUsageExtractor & PointerFlowExtractor ignore templates (PR #198927)

Balázs Benics via cfe-commits cfe-commits at lists.llvm.org
Thu May 21 02:39:31 PDT 2026


================
@@ -329,6 +329,12 @@ class PointerFlowTUSummaryExtractor : public TUSummaryExtractor {
 
     findContributors(Ctx, Contributors);
     for (auto *CD : Contributors) {
+      // Templates are skipped, but their instantiations are handled. The idea
+      // is that we can conclude facts about a template through all of its
+      // instantiations.
+      if (CD->isTemplated() || CD->getDeclContext()->isDependentContext())
----------------
steakhal wrote:

When I looked at the definition of `isTemplated`, the first thing it checked if it's a dependent decl context.
This suggests to me that the RHS part: `CD->getDeclContext()->isDependentContext()` is redundant.
Why did you add that?

Same question goes to the other hunk.

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


More information about the cfe-commits mailing list