[clang-tools-extra] [clang-tidy] Fix `cppcoreguidelines-prefer-member-initializer` false positive for inherited members (PR #153941)

via cfe-commits cfe-commits at lists.llvm.org
Sat Aug 16 13:09:26 PDT 2025


================
@@ -650,3 +650,20 @@ struct InitFromBindingDecl {
   }
 };
 } // namespace GH82970
+
+namespace inherited_members {
----------------
v1nh1shungry wrote:

Thanks for the review!

The suggestion is reasonable, and I'd also update the commit message and the release note to emphasize the "template" part.

I'm a little hesitant about changing the `inherited_members` namespace here, though. The name seems okay because it covers both normal and template subclasses. Although the checker used to work for the normal ones, it seems to have done so unintentionally. And the new tests in this namespace ensure both cases work. What do you think?

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


More information about the cfe-commits mailing list