File tree Expand file tree Collapse file tree 3 files changed +18
-3
lines changed Expand file tree Collapse file tree 3 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -72,11 +72,13 @@ static SourceLocation getInlineTokenLocation(SourceRange RangeLocation,
72
72
}
73
73
74
74
void RedundantInlineSpecifierCheck::registerMatchers (MatchFinder *Finder) {
75
+ const auto IsPartOfRecordDecl = hasAncestor (recordDecl ());
75
76
Finder->addMatcher (
76
77
functionDecl (isInlineSpecified (),
77
- anyOf (isConstexpr (), isDeleted (), isDefaulted (),
78
+ anyOf (isConstexpr (), isDeleted (),
79
+ allOf (isDefaulted (), IsPartOfRecordDecl),
78
80
isInternalLinkage (StrictMode),
79
- allOf (isDefinition (), hasAncestor ( recordDecl ()) )))
81
+ allOf (isDefinition (), IsPartOfRecordDecl )))
80
82
.bind (" fun_decl" ),
81
83
this );
82
84
@@ -88,7 +90,6 @@ void RedundantInlineSpecifierCheck::registerMatchers(MatchFinder *Finder) {
88
90
this );
89
91
90
92
if (getLangOpts ().CPlusPlus17 ) {
91
- const auto IsPartOfRecordDecl = hasAncestor (recordDecl ());
92
93
Finder->addMatcher (
93
94
varDecl (
94
95
isInlineSpecified (),
Original file line number Diff line number Diff line change @@ -313,6 +313,10 @@ Changes in existing checks
313
313
<clang-tidy/checks/readability/qualified-auto>` check by adding the option
314
314
`AllowedTypes `, that excludes specified types from adding qualifiers.
315
315
316
+ - Improved :doc: `readability-redundant-inline-specifier
317
+ <clang-tidy/checks/readability/redundant-inline-specifier>` check by fixing
318
+ false positives on out-of-line explicitly defaulted functions.
319
+
316
320
- Improved :doc: `readability-redundant-smartptr-get
317
321
<clang-tidy/checks/readability/redundant-smartptr-get>` check by fixing
318
322
some false positives involving smart pointers to arrays.
Original file line number Diff line number Diff line change @@ -149,3 +149,13 @@ class A
149
149
// CHECK-FIXES-STRICT: static float test4;
150
150
};
151
151
}
152
+
153
+ namespace ns {
154
+ class B
155
+ {
156
+ public:
157
+ ~B ();
158
+ };
159
+
160
+ inline B::~B () = default ;
161
+ }
You can’t perform that action at this time.
0 commit comments