Index: clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp =================================================================== --- clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp +++ clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp @@ -179,7 +179,7 @@ const auto *InitDecl = Init->isMemberInitializer() ? static_cast(Init->getMember()) - : Init->getBaseClass()->getAs()->getDecl(); + : Init->getBaseClass()->getAsCXXRecordDecl(); // Add all fields between current field up until the next intializer. for (; Decl != std::end(OrderedDecls) && *Decl != InitDecl; ++Decl) { @@ -398,7 +398,7 @@ // Remove any bases that were explicitly written in the initializer list. for (const CXXCtorInitializer *Init : Ctor->inits()) { if (Init->isBaseInitializer() && Init->isWritten()) - BasesToInit.erase(Init->getBaseClass()->getAs()->getDecl()); + BasesToInit.erase(Init->getBaseClass()->getAsCXXRecordDecl()); } if (BasesToInit.empty()) Index: test/clang-tidy/cppcoreguidelines-pro-type-member-init.cpp =================================================================== --- test/clang-tidy/cppcoreguidelines-pro-type-member-init.cpp +++ test/clang-tidy/cppcoreguidelines-pro-type-member-init.cpp @@ -338,3 +338,11 @@ Template F; }; + +template +class PositiveSelfInitialization : NegativeAggregateType +{ + PositiveSelfInitialization() : PositiveSelfInitialization() {} + // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: constructor does not initialize these bases: NegativeAggregateType + // CHECK-FIXES: PositiveSelfInitialization() : NegativeAggregateType(), PositiveSelfInitialization() {} +};