[clang-tools-extra] [clang-tidy] Fix crash in `cppcoreguidelines-pro-type-member-init` with alias template in constructor initializer (PR #192786)

Yanzuo Liu via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 23 18:58:18 PDT 2026


zwuis wrote:

> > * the added test case is **invalid**, which doesn't represent the original reproducer, and
> 
> I think i verified this added case will crash before this patch, and the original reproducer doesn't crash now too(https://godbolt.org/z/GW8YhxGbs), any more details?

I see. Thanks for the clarification.

> > * the added comment is wrong.
> 
> You are saying this is a FP?

No. The root cause is `getAsCXXRecordDecl` returns `nullptr` for dependent types, regardless of whether it is a target base class. If we change the test to `class X: public C<T>`, it still crashed.

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


More information about the cfe-commits mailing list