File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -119,18 +119,16 @@ UseDesignatedInitializersCheck::UseDesignatedInitializersCheck(
119
119
void UseDesignatedInitializersCheck::registerMatchers (MatchFinder *Finder) {
120
120
const auto HasBaseWithFields =
121
121
hasAnyBase (hasType (cxxRecordDecl (has (fieldDecl ()))));
122
-
123
- // see #133715
124
- const auto IsSTLArray =
125
- hasType (qualType (hasDeclaration (recordDecl (hasName (" ::std::array" )))));
126
-
127
122
Finder->addMatcher (
128
123
initListExpr (
129
124
hasType (cxxRecordDecl (RestrictToPODTypes ? isPOD () : isAggregate (),
130
- unless (HasBaseWithFields))
125
+ unless (anyOf (HasBaseWithFields,
126
+ IgnoreSingleElementAggregates
127
+ ? hasName (" ::std::array" )
128
+ : anything ())))
131
129
.bind (" type" )),
132
130
IgnoreSingleElementAggregates ? hasMoreThanOneElement () : anything (),
133
- unless (anyOf ( isFullyDesignated (), IsSTLArray )))
131
+ unless (isFullyDesignated ()))
134
132
.bind (" init" ),
135
133
this );
136
134
}
Original file line number Diff line number Diff line change @@ -173,7 +173,8 @@ Changes in existing checks
173
173
174
174
- Improved :doc: `modernize-use-designated-initializers
175
175
<clang-tidy/checks/modernize/use-designated-initializers>` check by avoiding
176
- diagnosing designated initializers for ``std::array `` initializations.
176
+ diagnosing designated initializers for ``std::array `` initializations when
177
+ `IgnoreSingleElementAggregates ` is false.
177
178
178
179
- Improved :doc: `modernize-use-ranges
179
180
<clang-tidy/checks/modernize/use-ranges>` check by updating suppress
You can’t perform that action at this time.
0 commit comments