This is an archive of the discontinued LLVM Phabricator instance.

PR11410 - Confusing diagnostic when trailing array element tries to call deleted default constructor
ClosedPublic

Authored by nikola on May 13 2014, 1:54 AM.

Details

Reviewers
rsmith
Summary

First change tries to fix the carret in the error diagnostic that points to leading brace of the initializer list. Kind (InitializationKind) variable is used to diagnose only initializer list elements that weren't specified, and as such it seems to make more sense to use the closing brace when pointing to where the error occurred. I'm not seeing any regression so I'm not sure if this is the right approach. We could pass both leading and trailing brace to Kind and Diagnose method could then choose which one to use for each failure type?

Second change is the note that explains where this default constructor comes from. It really feels like this code belongs inside Diagnose method but that method seems to deal only with the inner initializer list element and information about the whole initializer list (number of elements) doesn't seem to be available.

Diff Detail

Event Timeline

nikola updated this revision to Diff 9338.May 13 2014, 1:54 AM
nikola retitled this revision from to PR11410 - Confusing diagnostic when trailing array element tries to call deleted default constructor.
nikola updated this object.
nikola edited the test plan for this revision. (Show Details)
nikola added a reviewer: rsmith.
rsmith edited edge metadata.May 22 2014, 4:55 PM

Please add some testcases (you can check the location is right by putting the } on a line by itself).

nikola updated this revision to Diff 9794.May 25 2014, 8:28 PM
nikola edited edge metadata.
nikola added a subscriber: Unknown Object (MLST).

Added test.

rsmith accepted this revision.May 29 2014, 6:25 PM
rsmith edited edge metadata.

LGTM

This revision is now accepted and ready to land.May 29 2014, 6:25 PM
nikola closed this revision.May 29 2014, 6:36 PM

Done in r209869.