Index: cppcoreguidelines/ProTypeMemberInitCheck.cpp =================================================================== --- cppcoreguidelines/ProTypeMemberInitCheck.cpp +++ cppcoreguidelines/ProTypeMemberInitCheck.cpp @@ -179,6 +179,11 @@ const auto *Ctor = Result.Nodes.getNodeAs("ctor"); const auto &MemberFields = Ctor->getParent()->fields(); + // Skip delayed template instantiation declarations. + const auto *Body = Ctor->getBody(); + if (!Body) + return; + SmallPtrSet FieldsToInit; fieldsRequiringInit(MemberFields, FieldsToInit); if (FieldsToInit.empty()) @@ -193,7 +198,7 @@ continue; FieldsToInit.erase(Init->getMember()); } - removeFieldsInitializedInBody(*Ctor->getBody(), *Result.Context, + removeFieldsInitializedInBody(*Body, *Result.Context, FieldsToInit); if (FieldsToInit.empty()) return; Index: modernize/RedundantVoidArgCheck.cpp =================================================================== --- modernize/RedundantVoidArgCheck.cpp +++ modernize/RedundantVoidArgCheck.cpp @@ -105,8 +105,9 @@ SourceLocation Start = Function->getLocStart(); if (Function->isThisDeclarationADefinition()) { SourceLocation End; - if (Function->hasBody()) - End = Function->getBody()->getLocStart().getLocWithOffset(-1); + const auto *Body = Function->getBody(); + if (Body) + End = Body->getLocStart().getLocWithOffset(-1); else End = Function->getLocEnd(); removeVoidArgumentTokens(Result, SourceRange(Start, End),