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,
7272}
7373
7474void RedundantInlineSpecifierCheck::registerMatchers (MatchFinder *Finder) {
75+ const auto IsPartOfRecordDecl = hasAncestor (recordDecl ());
7576 Finder->addMatcher (
7677 functionDecl (isInlineSpecified (),
77- anyOf (isConstexpr (), isDeleted (), isDefaulted (),
78+ anyOf (isConstexpr (), isDeleted (),
79+ allOf (isDefaulted (), IsPartOfRecordDecl),
7880 isInternalLinkage (StrictMode),
79- allOf (isDefinition (), hasAncestor ( recordDecl ()) )))
81+ allOf (isDefinition (), IsPartOfRecordDecl )))
8082 .bind (" fun_decl" ),
8183 this );
8284
@@ -88,7 +90,6 @@ void RedundantInlineSpecifierCheck::registerMatchers(MatchFinder *Finder) {
8890 this );
8991
9092 if (getLangOpts ().CPlusPlus17 ) {
91- const auto IsPartOfRecordDecl = hasAncestor (recordDecl ());
9293 Finder->addMatcher (
9394 varDecl (
9495 isInlineSpecified (),
Original file line number Diff line number Diff line change @@ -313,6 +313,10 @@ Changes in existing checks
313313 <clang-tidy/checks/readability/qualified-auto>` check by adding the option
314314 `AllowedTypes `, that excludes specified types from adding qualifiers.
315315
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+
316320- Improved :doc: `readability-redundant-smartptr-get
317321 <clang-tidy/checks/readability/redundant-smartptr-get>` check by fixing
318322 some false positives involving smart pointers to arrays.
Original file line number Diff line number Diff line change @@ -149,3 +149,13 @@ class A
149149 // CHECK-FIXES-STRICT: static float test4;
150150};
151151}
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