<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Mar 9, 2015, at 5:20 PM, Richard Smith <<a href="mailto:richard@metafoo.co.uk" class="">richard@metafoo.co.uk</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class="gmail_extra"><div class="gmail_quote">On Sat, Mar 7, 2015 at 8:21 AM, Argyrios Kyrtzidis<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:kyrtzidis@apple.com" target="_blank" class="">kyrtzidis@apple.com</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;">Hi Richard,<br class=""><br class="">r231424 changed behavior of Sema::LookupVisibleDecls(). It now passes all re-declarations to the VisibleDeclConsumer, while it previously only passed the presumed ‘visible’ one which was the latest.<br class="">For example, If I have this code in a module header:<br class=""><br class="">----------------<br class="">struct Foo;  // #1<br class="">struct Foo;  // #2<br class="">struct Foo {  // #3<br class=""> <span class="Apple-converted-space"> </span>int x;<br class="">};<br class=""><br class="">void callme(void);  // #4<br class="">void callme(void);  // #5<br class="">void callme(void);  // #6<br class="">----------------<br class=""><br class="">LookupVisibleDecls() would previously pass only #3 and #6. Now the behavior is like this:<br class=""><br class="">- It passes all Foo’s #1-3#. For #2 and #3 it also sets ‘Hiding’ to #1.<br class="">- It passes all callme’s as well, #4-#6. ‘Hiding’ is never set for any of them.<br class=""><br class="">Is this behavior change expected ?</blockquote><div class=""><br class=""></div><div class="">It depends. If these declarations are all declared in the same module, then no, this is not expected; the lookup table should be unchanged in that case, and should only contain the most recent declaration. That'd be a bug; if this is the case, please send me a testcase and I'll dig into it.</div></div></div></div></div></blockquote><div><br class=""></div><div>Attached a few files, try this:</div><div><br class=""></div><div>- $ cd mod-test</div><div>- Debug this invocation:</div><div>$ env CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=t.m:2:1 t.m -fmodules -I .</div><div><br class=""></div><div>In CodeCompletionDeclConsumer::FoundDecl() (at SemaCodeComplete.cpp), watch which declarations are passed to this function, you’ll notice that all re-declarations of the same module (as in my original example) are getting through here.</div><div><br class=""></div><div></div></div></body></html>