File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -124,6 +124,9 @@ void UseDesignatedInitializersCheck::check(
124
124
if (SyntacticInitList->getNumInits () - NumberOfDesignated >
125
125
Designators.size ())
126
126
return ;
127
+
128
+ // If the whole initializer list is un-designated, issue only one warning and
129
+ // a single fix-it for the whole expression.
127
130
if (0 == NumberOfDesignated) {
128
131
if (IgnoreMacros && InitList->getBeginLoc ().isMacroID ())
129
132
return ;
@@ -142,6 +145,9 @@ void UseDesignatedInitializersCheck::check(
142
145
DiagnosticIDs::Note);
143
146
return ;
144
147
}
148
+
149
+ // In case that a only few elements are un-designated (not all as before), the
150
+ // check offers dedicated issues and fix-its for each of them.
145
151
for (const auto *InitExpr : *SyntacticInitList) {
146
152
if (isa<DesignatedInitExpr>(InitExpr))
147
153
continue ;
You can’t perform that action at this time.
0 commit comments