Index: clang-tidy/modernize/RedundantVoidArgCheck.cpp =================================================================== --- clang-tidy/modernize/RedundantVoidArgCheck.cpp +++ clang-tidy/modernize/RedundantVoidArgCheck.cpp @@ -49,7 +49,7 @@ return; Finder->addMatcher(functionDecl(parameterCountIs(0), unless(isImplicit()), - unless(isExternC())) + unless(isInstantiated()), unless(isExternC())) .bind(FunctionId), this); Finder->addMatcher(typedefNameDecl().bind(TypedefId), this); 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 @@ -488,3 +488,42 @@ // CHECK-MESSAGES: :[[@LINE-1]]:6: warning: redundant void argument list in lambda expression [modernize-redundant-void-arg] // CHECK-FIXES: []() BODY; } + + +struct S_1{ + void g_1(void) const{ + // CHECK-MESSAGES: :[[@LINE-1]]:11: warning: redundant void argument list in function definition [modernize-redundant-void-arg] + // CHECK-FIXES: void g_1() const{ + int a; + (void)a; + } + + void g_2() const { + int a; + (void)a; + } + +}; + +template +struct S_2{ + void g_1(void) const{ + // CHECK-MESSAGES: :[[@LINE-1]]:11: warning: redundant void argument list in function definition [modernize-redundant-void-arg] + // CHECK-FIXES: void g_1() const{ + int a; + (void)a; + } + + void g_2() const { + int a; + (void)a; + } +}; + +//Instantiation of the two structs. +void f_testTemplate(){ + S_1(); + S_2(); +} + +