[clang] [analyzer] Fix [[clang::suppress]] for nested templates (PR #183727)

Donát Nagy via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 2 06:53:47 PST 2026


================
@@ -179,9 +227,8 @@ bool BugSuppression::isSuppressed(const BugReport &R) {
 // attribute.
 //
 // The function handles two cases:
-// 1. Instantiation from a class template - searches redeclarations to find
-//    the definition (not just a forward declaration).
-// 2. Instantiation from a partial specialization - returns it directly.
+// 1. Class template specializations.
+// 2. Class template partial specializations.
 //
 // For non-template-specialization decls, returns the input unchanged.
----------------
NagyDonat wrote:

> What do you think is AI bloat in particular?

I felt that keeping the numbered list structure is unnecessary and the three lines
```c++
// The function handles two cases:
// 1. Class template specializations.
// 2. Class template partial specializations.
```
could be condensed to e.g.
```c++
// The function handles specializations and partial specializations of class
// templates.
```

Overall I would replace these five lines ("The function handles" – end of comment) with
```c++
// The function handles specializations (and partial specializations) of
// class templates. For any other decl, it returns the input unchagned.
```

Sorry for the accusation about AI use, I should have been more polite with this suggestion (which is after all just a minor stylistic nitpick).

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


More information about the cfe-commits mailing list