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 Stmt *Body = Ctor->getBody(); + if (!Body) + return; + SmallPtrSet FieldsToInit; fieldsRequiringInit(MemberFields, FieldsToInit); if (FieldsToInit.empty()) @@ -193,8 +198,8 @@ continue; FieldsToInit.erase(Init->getMember()); } - removeFieldsInitializedInBody(*Ctor->getBody(), *Result.Context, - FieldsToInit); + removeFieldsInitializedInBody(*Body, *Result.Context, FieldsToInit); + if (FieldsToInit.empty()) return; Index: modernize/RedundantVoidArgCheck.cpp =================================================================== --- modernize/RedundantVoidArgCheck.cpp +++ modernize/RedundantVoidArgCheck.cpp @@ -104,13 +104,10 @@ const MatchFinder::MatchResult &Result, const FunctionDecl *Function) { SourceLocation Start = Function->getLocStart(); if (Function->isThisDeclarationADefinition()) { - SourceLocation End; - if (Function->hasBody()) - End = Function->getBody()->getLocStart().getLocWithOffset(-1); - else - End = Function->getLocEnd(); - removeVoidArgumentTokens(Result, SourceRange(Start, End), - "function definition"); + const Stmt *Body = Function->getBody(); + SourceRange range(Start, Body ? Body->getLocStart().getLocWithOffset(-1) : + Function->getLocEnd()); + removeVoidArgumentTokens(Result, range, "function definition"); } else { removeVoidArgumentTokens(Result, Function->getSourceRange(), "function declaration");