[llvm-branch-commits] [clang] [SSAF] Properly handle contributors with multiple declarations (PR #204482)
Balázs Benics via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Fri Jun 19 08:52:09 PDT 2026
================
@@ -0,0 +1,24 @@
+// REQUIRES: asserts
+// RUN: rm -rf %t && mkdir -p %t
+// RUN: %clang_cc1 -fsyntax-only -std=c++20 %s \
+// RUN: --ssaf-extract-summaries=PointerFlow \
+// RUN: --ssaf-tu-summary-file=%t/tu.summary.json \
+// RUN: --ssaf-compilation-unit-id="tu-1" \
+// RUN: -mllvm -debug-only=ssaf-analyses 2>&1 | FileCheck %s
+
+// The two `Holder<decltype([]{})>` instantiations have distinct types but
+// produce colliding USRs for `reset`. The extractor must keep one summary and
+// drop the other with a diagnostic, instead of crashing.
+
+// CHECK: dropping duplicate PointerFlow summary
+
+template <class T>
+struct Holder {
+ T *p;
+ void reset(T *x) { p = x; }
+};
----------------
steakhal wrote:
Shouldn't we rather fix USR generation instead?
https://github.com/llvm/llvm-project/pull/204482
More information about the llvm-branch-commits
mailing list