<table><tr><td style="">buschinski created this revision.<br />buschinski added a reviewer: KDevelop.<br />Herald added a project: KDevelop.<br />Herald added a subscriber: kdevelop-devel.<br />buschinski 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/D22455">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>The code completion always shows the first declaration it finds for a matching name.<br />
This works fine as long as the parent has a name, for nameless structs/unions it just returns the first declaration it finds.<br />
Fix this by checking that the found declaration has the expected type.</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>See <a href="https://bugs.kde.org/show_bug.cgi?id=409041" class="remarkup-link" target="_blank" rel="noreferrer">https://bugs.kde.org/show_bug.cgi?id=409041</a> for example code<br />
or see the unit test in this patch.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R32 KDevelop</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D22455">https://phabricator.kde.org/D22455</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>plugins/clang/codecompletion/context.cpp<br />
plugins/clang/tests/test_codecompletion.cpp<br />
plugins/clang/tests/test_codecompletion.h</div></div></div><br /><div><strong>To: </strong>buschinski, KDevelop<br /><strong>Cc: </strong>kdevelop-devel, hmitonneau, christiant, glebaccon, domson, antismap, iodelay, alexeymin, geetamc, Pilzschaf, akshaydeo, surgenight, arrowd<br /></div>