<p dir="ltr">None of the other Redeclarable DeclContexts we currently have want this behaviour. (And in the presence of C++ modules, it wouldn't be correct - in that case, we only want to perform lookups into the class definition, not into any other class definition we've merged with it).</p>

<p dir="ltr">I suggest you just special-case the two forms of namespace. (Or use Objective-C++ ;).)</p>
<div class="gmail_quote">On 9 Feb 2014 02:48, "Kyle Sluder" <<a href="mailto:kyle@ksluder.com">kyle@ksluder.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi folks,<br>
<br>
I'm hacking on an implementation of namespaces for Objective-C, which<br>
you can follow here:<br>
<a href="https://github.com/kylesluder/objc-namespaces/tree/develop" target="_blank">https://github.com/kylesluder/objc-namespaces/tree/develop</a><br>
<br>
While extending DeclContext to cover ObjC namespaces, I noticed that<br>
DeclContext::collectAllContexts() specifically only works on<br>
NamespaceDecls.<br>
<br>
The log attached to that commit explicitly calls out<br>
Redeclarable<NamespaceDecl>, so I'm curious why the code checks for<br>
NamespaceDecl rather than working for all Redeclarable<> subtypes.<br>
<br>
This is relevant to me, as I would like my namespaces to be redeclarable<br>
as well. :) And presumably, if another kind of redeclarable DeclContext<br>
comes along, it too would want to participate. (In fact, I'm surprised<br>
this doesn't already cause problems with ObjCInterfaceDecl.)<br>
<br>
Would the project be interested in a patch that made this work with all<br>
classes that derive from Redeclarable<>?<br>
<br>
--Kyle Sluder<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
</blockquote></div>