Use Incomplete flag only when not parsing a translation unit
ClosedPublic

Authored by olivierjg on Nov 3 2015, 7:22 AM.

Details

Reviewers
mwolff
kfunk
Group Reviewers
KDevelop
Summary

As discussed on cfe-dev, this can prevent template instantiations from being created.
I also notice that I get fewer spurious diagnostics with this fix.
It seems reasonable to not use Incomplete when parsing a proper TU url.

Diff Detail

Repository
R32 KDevelop
Lint
Lint Skipped
Unit
Unit Tests Skipped
olivierjg updated this revision to Diff 1142.Nov 3 2015, 7:22 AM
olivierjg retitled this revision from to Use Incomplete flag only when not parsing a translation unit.
olivierjg updated this object.
olivierjg edited the test plan for this revision. (Show Details)
olivierjg added a reviewer: KDevelop.
olivierjg set the repository for this revision to R32 KDevelop.
olivierjg added a project: KDevelop.
Restricted Application added a subscriber: kdevelop-devel. ยท View Herald TranscriptNov 3 2015, 7:22 AM
kfunk accepted this revision.Nov 3 2015, 9:13 AM
kfunk added a reviewer: kfunk.
kfunk added a subscriber: kfunk.

LGTM, but can you show me the discussion?

Maybe even add a link to the discussion to the source code.

This revision is now accepted and ready to land.Nov 3 2015, 9:13 AM
mwolff added a subscriber: mwolff.Nov 3 2015, 11:23 AM

Tentative +1, but what happens without the Incomplete flag when we have a parse error due to the background parser kicking in while we are typing? Do we still get a (partial) AST then, or will it break early like the real compiler?

According to the documentation, this just means that "semantic analysis that is typically performed at the end of the translation unit will be suppressed"

I don't notice any instances of the compiler bailing on error either -- we still get a complete AST afaict.

mwolff accepted this revision.Nov 3 2015, 8:36 PM
mwolff added a reviewer: mwolff.

ok, please add a link to the discussion as requested by kevin, then +1 from my side.

unit tests all continue to pass, I guess.

olivierjg closed this revision.Nov 3 2015, 8:48 PM

Submitted