@@ -28,22 +28,18 @@ void RedundantTypenameCheck::registerMatchers(MatchFinder *Finder) {
28
28
29
29
// NOLINTBEGIN(readability-identifier-naming)
30
30
const VariadicDynCastAllOfMatcher<Stmt, CXXNamedCastExpr> cxxNamedCastExpr;
31
- const auto inImplicitTypenameContext = [&] {
32
- return anyOf (hasParent (typedefNameDecl ()),
33
- hasParent (templateTypeParmDecl ()),
34
- hasParent (nonTypeTemplateParmDecl ()),
35
- hasParent (cxxNamedCastExpr ()), hasParent (cxxNewExpr ()),
36
- hasParent (friendDecl ()), hasParent (fieldDecl ()),
37
- hasParent (parmVarDecl (hasParent (expr (requiresExpr ())))),
38
- hasParent (parmVarDecl (hasParent (typeLoc (hasParent (namedDecl (
39
- anyOf (cxxMethodDecl (), hasParent (friendDecl ()),
40
- functionDecl (has (nestedNameSpecifier ()))))))))),
41
- // Match return types.
42
- hasParent (functionDecl (unless (cxxConversionDecl ()))));
43
- };
31
+ const auto inImplicitTypenameContext = anyOf (
32
+ hasParent (typedefNameDecl ()), hasParent (templateTypeParmDecl ()),
33
+ hasParent (nonTypeTemplateParmDecl ()), hasParent (cxxNamedCastExpr ()),
34
+ hasParent (cxxNewExpr ()), hasParent (friendDecl ()), hasParent (fieldDecl ()),
35
+ hasParent (parmVarDecl (hasParent (expr (requiresExpr ())))),
36
+ hasParent (parmVarDecl (hasParent (typeLoc (hasParent (
37
+ namedDecl (anyOf (cxxMethodDecl (), hasParent (friendDecl ()),
38
+ functionDecl (has (nestedNameSpecifier ()))))))))),
39
+ // Match return types.
40
+ hasParent (functionDecl (unless (cxxConversionDecl ()))));
44
41
// NOLINTEND(readability-identifier-naming)
45
- Finder->addMatcher (typeLoc (inImplicitTypenameContext ()).bind (" typeloc" ),
46
- this );
42
+ Finder->addMatcher (typeLoc (inImplicitTypenameContext).bind (" typeloc" ), this );
47
43
}
48
44
49
45
void RedundantTypenameCheck::check (const MatchFinder::MatchResult &Result) {
0 commit comments