File tree Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -61,18 +61,18 @@ void RedundantInlineSpecifierCheck::registerMatchers(MatchFinder *Finder) {
61
61
allOf (isDefinition (), hasAncestor (recordDecl ()))))
62
62
.bind (" fun_decl" ),
63
63
this );
64
-
65
- Finder->addMatcher (
66
- varDecl (isInlineSpecified (),
67
- anyOf (isInAnonymousNamespace (),
68
- allOf (isConstexpr (), hasAncestor (recordDecl ()))))
69
- .bind (" var_decl" ),
70
- this );
71
-
72
64
Finder->addMatcher (
73
65
functionTemplateDecl (has (functionDecl (isInlineSpecified ())))
74
66
.bind (" templ_decl" ),
75
67
this );
68
+ if (getLangOpts ().CPlusPlus17 ) {
69
+ Finder->addMatcher (
70
+ varDecl (isInlineSpecified (),
71
+ anyOf (isInAnonymousNamespace (),
72
+ allOf (isConstexpr (), hasAncestor (recordDecl ()))))
73
+ .bind (" var_decl" ),
74
+ this );
75
+ }
76
76
}
77
77
78
78
template <typename T>
Original file line number Diff line number Diff line change 1
- // RUN: %check_clang_tidy %s readability-redundant-inline-specifier %t
1
+ // RUN: %check_clang_tidy %s readability-redundant-inline-specifier -std=c++17 %t
2
2
3
3
template <typename T> inline T f ()
4
4
// CHECK-MESSAGES: :[[@LINE-1]]:23: warning: function 'f' has inline specifier but is implicitly inlined [readability-redundant-inline-specifier]
You can’t perform that action at this time.
0 commit comments