Add ExplicitlyTyped flag to Declaration.
ClosedPublic

Authored by michalsrb on Aug 14 2018, 2:33 PM.

Details

Summary

Explicitly typed declaration has the type writen as part of the declaration. The opposite, implicitly typed declaration, has the type deduced by the compiler.

E.g. in C++ variable declarations are explicitly typed unless the "auto" keyword is used.

The intended use is to display inline note with the deduced type next to all implicitly typed declarations.
Another use, maybe a bit of a stretch; Suggestions on the right side of assignment to an explicitly typed declaration should take the declaration type into consideration, but assignments to implicitly typed declaration should ignore the currently deduced type, since it will change into whatever new type will be assigned into it.

Test Plan

The plugins/clang/tests/files/variables.cpp was extended to test the basic C++ case.

Diff Detail

Repository
R32 KDevelop
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
michalsrb created this revision.Aug 14 2018, 2:33 PM
Restricted Application added a project: KDevelop. · View Herald TranscriptAug 14 2018, 2:33 PM
Restricted Application added a subscriber: kdevelop-devel. · View Herald Transcript
michalsrb requested review of this revision.Aug 14 2018, 2:33 PM
brauch accepted this revision.Aug 14 2018, 2:53 PM

Looks good to me, even with unit test! :)
If nobody objects within the next few days, I'll merge this.

Thank you for the patch!

This revision is now accepted and ready to land.Aug 14 2018, 2:53 PM
This revision was automatically updated to reflect the committed changes.