File tree 2 files changed +7
-8
lines changed
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
+ : unless (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 @@ -184,7 +184,8 @@ Changes in existing checks
184
184
185
185
- Improved :doc: `modernize-use-designated-initializers
186
186
<clang-tidy/checks/modernize/use-designated-initializers>` check by avoiding
187
- diagnosing designated initializers for ``std::array `` initializations.
187
+ diagnosing designated initializers for ``std::array `` initializations when
188
+ `IgnoreSingleElementAggregates ` is false.
188
189
189
190
- Improved :doc: `modernize-use-ranges
190
191
<clang-tidy/checks/modernize/use-ranges>` check by updating suppress
You can’t perform that action at this time.
0 commit comments