[all-commits] [llvm/llvm-project] 42bc32: [clang-tidy] Fix `readability-redundant-declaratio...
FabianWolff via All-commits
all-commits at lists.llvm.org
Mon Jan 17 11:57:21 PST 2022
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 42bc3275d3687524ddc0d20c72722b9324f87be4
https://github.com/llvm/llvm-project/commit/42bc3275d3687524ddc0d20c72722b9324f87be4
Author: Fabian Wolff <fabian.wolff at alumni.ethz.ch>
Date: 2022-01-17 (Mon, 17 Jan 2022)
Changed paths:
M clang-tools-extra/clang-tidy/readability/RedundantDeclarationCheck.cpp
M clang-tools-extra/test/clang-tidy/checkers/readability-redundant-declaration.cpp
Log Message:
-----------
[clang-tidy] Fix `readability-redundant-declaration` false positive for template friend declaration
Fixes [[ https://bugs.llvm.org/show_bug.cgi?id=48086 | PR#48086 ]]. The problem is that the current matcher uses `hasParent()` to detect friend declarations, but for a template friend declaration, the immediate parent of the `FunctionDecl` is a `FunctionTemplateDecl`, not the `FriendDecl`. Therefore, I have replaced the matcher with `hasAncestor()`.
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D114299
More information about the All-commits
mailing list