File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -12886,7 +12886,8 @@ void Sema::CheckCompleteVariableDeclaration(VarDecl *var) {
12886
12886
AttributeCommonInfo::AS_Pragma));
12887
12887
}
12888
12888
12889
- if (var->hasInit() && isa<InitListExpr>(var->getInit())) {
12889
+ if (!var->getType()->isStructureType() && var->hasInit() &&
12890
+ isa<InitListExpr>(var->getInit())) {
12890
12891
const auto *ILE = cast<InitListExpr>(var->getInit());
12891
12892
unsigned NumInits = ILE->getNumInits();
12892
12893
if (NumInits > 2)
@@ -12927,7 +12928,7 @@ void Sema::CheckCompleteVariableDeclaration(VarDecl *var) {
12927
12928
Diag(SL->getBeginLoc(),
12928
12929
diag::note_concatenated_string_literal_silence);
12929
12930
}
12930
- // Warn just once .
12931
+ // In any case, stop now .
12931
12932
break;
12932
12933
}
12933
12934
}
Original file line number Diff line number Diff line change @@ -148,6 +148,12 @@ const A not_warn6 = A{"",
148
148
"" };
149
149
#endif
150
150
151
+ static A not_warn7 = {"" ,
152
+
153
+ ""
154
+ "" ,
155
+ "" };
156
+
151
157
152
158
// Do not warn when all the elements in the initializer are concatenated together.
153
159
const char * all_elems_in_init_concatenated [] = {"a" "b" "c" };
You can’t perform that action at this time.
0 commit comments