<div dir="ltr">On Thu, Oct 10, 2013 at 8:03 AM, Vassil Vassilev <span dir="ltr"><<a href="mailto:vasil.georgiev.vasilev@cern.ch" target="_blank">vasil.georgiev.vasilev@cern.ch</a>></span> wrote:<br><div class="gmail_extra">
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
Is there any particular reason DeclContext::addHiddenDecl to not call NamedDecl::setHidden() on the added declaration?<br></blockquote><div><br></div><div>Yes. addHiddenDecl doesn't make a declaration hidden, it adds it without making it visible. This can be part of the process of making a declaration visible... or not. It doesn't make any sense for this to mark the declaration as hidden. (Also, declarations marked as hidden are still in the name lookup structures, so these mean different things.)</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
It feels like an inconsistency to me, because one can add a 'hidden' NamedDecl and later on to call removeDecl. In that case the DeclContext would assert because the name wasn't found in the lookup table. Is there something I missed?</blockquote>
<div><br></div><div>removeDecl is only used in very restricted circumstances, so this isn't a problem in practice. Nor does it check whether the declaration is marked as 'hidden' -- that doesn't affect whether the name appears in the lookup table anyway, so wouldn't be a sensible check.</div>
</div></div></div>