<table><tr><td style="">mwolff created this revision.<br />mwolff added a reviewer: KDevelop.<br />Herald added a project: KDevelop.<br />Herald added a subscriber: kdevelop-devel.<br />mwolff requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D18097">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>This patch lets us view the size information when inspecting type<br />
aliases. E.g. for C++ code like the following, we'll now see the<br />
size (8) and alignment (also 8) when hovering Bar. Previously,<br />
that was only shown when hovering Foo:</p>

<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">struct Foo { double m; };
using Bar = Foo;</pre></div>

<p>Sadly, this patch by its own isn't yet enough for the more interesting<br />
cases, namely aliases of explicit template instantiations, such as</p>

<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">using Ptr = std::shared_ptr<int>;</pre></div>

<p>Here, we still don't show any size information, since we don't track<br />
that information properly. In the builder, we only encounter std::shared_ptr<br />
as a template, which doesn't have any size information yet. We would<br />
need to build a declaration for the template instantiation of<br />
std::shared_ptr, at which point we could ask libclang for the concrete size...</p>

<p>Still, this patch goes into the right direction already, I believe.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R32 KDevelop</div></div></div><br /><div><strong>BRANCH</strong><div><div>master</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D18097">https://phabricator.kde.org/D18097</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>kdevplatform/language/duchain/navigation/abstractdeclarationnavigationcontext.cpp<br />
kdevplatform/language/duchain/navigation/abstractdeclarationnavigationcontext.h</div></div></div><br /><div><strong>To: </strong>mwolff, KDevelop<br /><strong>Cc: </strong>kdevelop-devel, glebaccon, hase, antismap, iodelay, geetamc, Pilzschaf, akshaydeo, surgenight, arrowd<br /></div>