<div dir="ltr">What about the lexical decl context?<div><br></div><div>/Eric</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 30, 2018 at 10:26 AM, Eric Liu via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>In the following example, an "implicit" declaration of "class Y" will be created for "friend class Y" (it's not marked as implicit in AST because it's actually written in the friend declaration), and it will have the same USR as the real declaration. I couldn't find a way to tell whether such decl was created by the friend decl when only given the NamedDecl. Checking its DeclContext doesn't help because the context is the namespace nx. <br></div><div><ul class="m_6369776092691482248inbox-inbox-bv2-edit-issue-history-stream" style="margin:0px;border:0px;outline:0px;font-size:13px;font-family:Arial,Helvetica,sans-serif;vertical-align:baseline;list-style:none;padding-left:15px;padding-right:15px"><li class="m_6369776092691482248inbox-inbox-bv2-event" style="margin:0px;border-width:0px 0px 1px;border-top-style:initial;border-right-style:initial;border-bottom-style:solid;border-left-style:initial;border-top-color:initial;border-right-color:initial;border-bottom-color:rgb(229,229,229);border-left-color:initial;outline:0px;font-weight:inherit;font-style:inherit;font-family:inherit;vertical-align:baseline;line-height:17px;width:1370px"><div class="m_6369776092691482248inbox-inbox-bv2-event-content-cell" style="margin:0px 0px 0px 40px;border:0px;outline:0px;font-weight:inherit;font-style:inherit;font-family:inherit;vertical-align:baseline;padding:15px 15px 0px"><div class="m_6369776092691482248inbox-inbox-bv2-event-note-container" style="margin:0px 0px 15px;border:0px;outline:0px;font-weight:inherit;font-style:inherit;font-family:inherit;vertical-align:baseline"><div class="m_6369776092691482248inbox-inbox-bv2-event-note" style="margin:15px 0px 0px;border:0px;outline:0px;font-weight:inherit;font-style:inherit;font-family:inherit;vertical-align:baseline;line-height:18px;word-wrap:break-word"><div class="m_6369776092691482248inbox-inbox-nonLatin m_6369776092691482248inbox-inbox-bv2-content-section" style="margin:0px 4.5em 0px 0px;border:0px;outline:0px;font-weight:inherit;font-style:inherit;font-family:inherit;vertical-align:baseline">```<br>namespace nx { <br>class X { <br> friend class Y; <br>}; <br>class Y {}; <br>} // namespace nx <br>``</div></div></div></div></li></ul><div>I'm wondering if this is actually possible. If not, would it make sense to flag decls created by friend decls in the AST?<font face="Arial, Helvetica, sans-serif"><br></font></div></div><div><br></div><div>Thanks,</div><div>Eric</div></div>
<br>______________________________<wbr>_________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div>