Index: clang-tidy/modernize/RedundantVoidArgCheck.cpp =================================================================== --- clang-tidy/modernize/RedundantVoidArgCheck.cpp +++ clang-tidy/modernize/RedundantVoidArgCheck.cpp @@ -116,9 +116,12 @@ const MatchFinder::MatchResult &Result, const FunctionDecl *Function) { SourceLocation Start = Function->getLocStart(); if (Function->isThisDeclarationADefinition()) { - SourceLocation BeforeBody = - Function->getBody()->getLocStart().getLocWithOffset(-1); - removeVoidArgumentTokens(Result, SourceRange(Start, BeforeBody), + SourceLocation End; + if (Function->hasBody()) + End = Function->getBody()->getLocStart().getLocWithOffset(-1); + else + End = Function->getLocEnd(); + removeVoidArgumentTokens(Result, SourceRange(Start, End), "function definition"); } else { removeVoidArgumentTokens(Result, Function->getSourceRange(), Index: test/clang-tidy/modernize-redundant-void-arg.cpp =================================================================== --- test/clang-tidy/modernize-redundant-void-arg.cpp +++ test/clang-tidy/modernize-redundant-void-arg.cpp @@ -433,3 +433,9 @@ F(Foo, Bar) { } + +struct DefinitionWithNoBody { + DefinitionWithNoBody(void) = delete; + // CHECK-MESSAGES: :[[@LINE-1]]:24: warning: {{.*}} in function definition + // CHECK-FIXES: DefinitionWithNoBody() = delete; +};