Fixes PR26740.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
clang-tidy/misc/UnusedParametersCheck.cpp | ||
---|---|---|
20 ↗ | (On Diff #49951) | There's a matcher for this: isOverride. |
clang-tidy/misc/UnusedParametersCheck.cpp | ||
---|---|---|
80 ↗ | (On Diff #49954) | I meant, you can use it inside UsedByRef. |
clang-tidy/misc/UnusedParametersCheck.cpp | ||
---|---|---|
80 ↗ | (On Diff #49954) | Looks like we can't make it in UsedByRef. The ast_matchers::match argument passed in UsedByRef is a TranslationUnitDecl type, which isn't used to match CXXMethodDecl. the code below is always true: ast_matchers::match( cxxMethodDecl(isOverride()), *Result.Context->getTranslationUnitDecl(), *Result.Context).empty() |
clang-tidy/misc/UnusedParametersCheck.cpp | ||
---|---|---|
67 ↗ | (On Diff #49954) | It looks like the two-parameter ast_matchers::match function would be better here (and it will allow to get rid of the decl(hasDescendant( part). Something like this: return !ast_matchers::match(declRefExpr(...), *Result.Context).empty(); |
80 ↗ | (On Diff #49954) | That's why I don't like default lambda captures: They make it totally unclear which actual parameters the lambda accepts. Then the initial solution looks better than the current one using ast_matchers::match. Sorry for the noise. |
clang-tidy/misc/UnusedParametersCheck.cpp | ||
---|---|---|
74 ↗ | (On Diff #49951) | Done. I also removed this lambda function. |
clang-tidy/misc/UnusedParametersCheck.cpp | ||
---|---|---|
80 ↗ | (On Diff #52179) | nit: Please update formatting. |