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(
119119void UseDesignatedInitializersCheck::registerMatchers (MatchFinder *Finder) {
120120 const auto HasBaseWithFields =
121121 hasAnyBase (hasType (cxxRecordDecl (has (fieldDecl ()))));
122-
123- // see #133715
124- const auto IsSTLArray =
125- hasType (qualType (hasDeclaration (recordDecl (hasName (" ::std::array" )))));
126-
127122 Finder->addMatcher (
128123 initListExpr (
129124 hasType (cxxRecordDecl (RestrictToPODTypes ? isPOD () : isAggregate (),
130- unless (HasBaseWithFields))
125+ unless (anyOf (HasBaseWithFields,
126+ IgnoreSingleElementAggregates
127+ ? hasName (" ::std::array" )
128+ : unless (anything ()))))
131129 .bind (" type" )),
132130 IgnoreSingleElementAggregates ? hasMoreThanOneElement () : anything (),
133- unless (anyOf ( isFullyDesignated (), IsSTLArray )))
131+ unless (isFullyDesignated ()))
134132 .bind (" init" ),
135133 this );
136134}
Original file line number Diff line number Diff line change @@ -184,7 +184,8 @@ Changes in existing checks
184184
185185- Improved :doc: `modernize-use-designated-initializers
186186 <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.
188189
189190- Improved :doc: `modernize-use-ranges
190191 <clang-tidy/checks/modernize/use-ranges>` check by updating suppress
You can’t perform that action at this time.
0 commit comments