[clang] [analyzer] Fix [[clang::suppress]] for tricky template specializations (PR #178441)
Ziqing Luo via cfe-commits
cfe-commits at lists.llvm.org
Thu Jan 29 11:02:07 PST 2026
================
@@ -0,0 +1,33 @@
+// RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -verify %s
+// expected-no-diagnostics
+
+void clang_analyzer_warnIfReached();
+
+// Forward declaration
+namespace N { // 1st
+template <class T> struct Wrapper;
----------------
ziqingluo-90 wrote:
hmm... actually, for `DeclWithIssue initially was 0xacad0d4d0 CXXMethod`, there are two possibilities:
- it is the `CXXMethod` in the template definition; or
- it is the `CXXMethod` in the template specialization declaration.
Although none of their lexical parents should be in the second namespace, I wonder if we try to start with a different `CXXMethod`, the result might be different🧐.
https://github.com/llvm/llvm-project/pull/178441
More information about the cfe-commits
mailing list