InGroup<Uninitialized>, DefaultIgnore;
def note_block_var_fixit_add_initialization : Note<
"maybe you meant to use __block %0">;
+def note_omitted_element_default_constructed : Note<
+ "initializer list shorter than initialized object, omitted element was "
+ "implicitly default constructed">;
def note_var_fixit_add_initialization : Note<
"initialize the variable %0 to silence this warning">;
def note_uninit_fixit_remove_cond : Note<
bool &RequiresSecondPass) {
assert((ILE->getType() != SemaRef.Context.VoidTy) &&
"Should not have void type");
- SourceLocation Loc = ILE->getLocStart();
- if (ILE->getSyntacticForm())
- Loc = ILE->getSyntacticForm()->getLocStart();
if (const RecordType *RType = ILE->getType()->getAs<RecordType>()) {
const RecordDecl *RDecl = RType->getDecl();
} else
ElementType = ILE->getType();
+ SourceLocation Loc = ILE->getLocEnd();
+ if (ILE->getSyntacticForm())
+ Loc = ILE->getSyntacticForm()->getLocEnd();
for (unsigned Init = 0; Init != NumElements; ++Init) {
if (hadError)
InitializationSequence InitSeq(SemaRef, ElementEntity, Kind, None);
if (!InitSeq) {
InitSeq.Diagnose(SemaRef, ElementEntity, Kind, None);
+ if (NumInits < NumElements &&
+ InitSeq.getFailureKind() ==
+ InitializationSequence::FK_ConstructorOverloadFailed &&
+ InitSeq.getFailedOverloadResult() == OverloadingResult::OR_Deleted)
+ SemaRef.Diag(Loc, diag::note_omitted_element_default_constructed);
hadError = true;
return;
}