Index: clang-tools-extra/clang-tidy/readability/RedundantDeclarationCheck.cpp =================================================================== --- clang-tools-extra/clang-tidy/readability/RedundantDeclarationCheck.cpp +++ clang-tools-extra/clang-tidy/readability/RedundantDeclarationCheck.cpp @@ -37,7 +37,7 @@ functionDecl(unless(anyOf( isDefinition(), isDefaulted(), doesDeclarationForceExternallyVisibleDefinition(), - hasParent(friendDecl())))))) + hasAncestor(friendDecl())))))) .bind("Decl"), this); } Index: clang-tools-extra/test/clang-tidy/checkers/readability-redundant-declaration.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/readability-redundant-declaration.cpp +++ clang-tools-extra/test/clang-tidy/checkers/readability-redundant-declaration.cpp @@ -66,8 +66,14 @@ struct Friendly { friend void best_friend(); friend void enemy(); + + template + friend void generic_friend(); }; +template +void generic_friend() {} + void enemy(); namespace macros {