Ignore warning uninstantiated template function usages.
Details
- Reviewers
djasper alexfh - Commits
- rG47ea5424d2d6: [clang-tidy] Fix a template function false positive in misc-unused-using-decls…
rCTE269906: [clang-tidy] Fix a template function false positive in misc-unused-using-decls…
rL269906: [clang-tidy] Fix a template function false positive in misc-unused-using…
Diff Detail
Event Timeline
clang-tidy/misc/UnusedUsingDeclsCheck.cpp | ||
---|---|---|
24 | I think, we should use a node matcher for UnresolvedLookupExpr and instead use callExpr(callee(unresolvedLookupExpr().bind("something"))). Also, I would create the new matcher in the ASTMatchers.h right away, together with a test and docs. But if you want this patch to be in soon, feel free to move the matcher to the matchers library in a follow up. |
clang-tidy/misc/UnusedUsingDeclsCheck.cpp | ||
---|---|---|
24 | Agree. I will add a node matcher for UnresolvedLookupExpr in a follow-up patch. |
clang-tidy/misc/UnusedUsingDeclsCheck.cpp | ||
---|---|---|
24 | Sorry for being unclear. Please change this to the node matcher in this patch. You can move the matcher to the ASTMatchers.h as a follow-up. hasUnresolvedLookupExpr is not in line with the matchers design: the CallExpr node has no property UnresolvedLookupExpr. You'll also be able to bind the UnresolvedLookupExpr to an identifier and make the code in check() slightly shorter. |
clang-tidy/misc/UnusedUsingDeclsCheck.cpp | ||
---|---|---|
24 | Done. But currently we can't bind the UnresolvedLookupExpr directly since the AST_MATCHER doesn't provide a bind function here. |
clang-tidy/misc/UnusedUsingDeclsCheck.cpp | ||
---|---|---|
24 | That's because we need a node matcher, not narrowing matcher. I guess, this should work: const internal::VariadicAllOfMatcher<UnresolvedLookupExpr> unresolvedLookupExpr; |
clang-tidy/misc/UnusedUsingDeclsCheck.cpp | ||
---|---|---|
24 | Yeah. But as the name indicates, VariadicAllOfMatcher is used internally in ASTMatcher, is it reasonable to use it here? I can't find such usage in clang-tidy side. |
clang-tidy/misc/UnusedUsingDeclsCheck.cpp | ||
---|---|---|
24 | There are far fewer nodes in the AST than their properties, so the core matchers library should contain all node matchers. Thus, the user code is not supposed to create any node matchers and the corresponding API is considered an implementation detail of the matchers library. It's fine to use internal API here for a short period until we move the matcher to the core matchers library. |
clang-tidy/misc/UnusedUsingDeclsCheck.cpp | ||
---|---|---|
24 | Sounds good. Done. |
I think, we should use a node matcher for UnresolvedLookupExpr and instead use callExpr(callee(unresolvedLookupExpr().bind("something"))).
Also, I would create the new matcher in the ASTMatchers.h right away, together with a test and docs. But if you want this patch to be in soon, feel free to move the matcher to the matchers library in a follow up.