<div dir="ltr">r209511</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, May 23, 2014 at 11:06 AM, Nikola Smiljanic <span dir="ltr"><<a href="mailto:popizdeh@gmail.com" target="_blank">popizdeh@gmail.com</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">That's what I asked in my first email :D I don't see any existing tests for something like this...</div>

<div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, May 23, 2014 at 11:05 AM, Richard Smith <span dir="ltr"><<a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</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">LGTM<div><br></div><div>Is there any way you can test this?</div></div><div><div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, May 19, 2014 at 3:07 PM, Nikola Smiljanic <span dir="ltr"><<a href="mailto:popizdeh@gmail.com" target="_blank">popizdeh@gmail.com</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">Ping.</div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Fri, May 16, 2014 at 9:44 AM, Nikola Smiljanic <span dir="ltr"><<a href="mailto:popizdeh@gmail.com" target="_blank">popizdeh@gmail.com</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">Waiting for an OK from you Richard :)</div><div><div><div class="gmail_extra">

<br><br><div class="gmail_quote">On Sat, May 10, 2014 at 7:38 PM, Nikola Smiljanic <span dir="ltr"><<a href="mailto:popizdeh@gmail.com" target="_blank">popizdeh@gmail.com</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">I figured out what's going on, I was initially trying to use the location returned by getTypeSpecTypeNameLoc but decided against it once I saw the assert in this function. Using the location from TypeSourceInfo does seem to give more consistent result. Location always points to whatever comes after 'friend' keyword. The change itself is a oneliner. Are you guys happy with this version?</div>






<div><div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, May 9, 2014 at 11:55 AM, Nikola Smiljanic <span dir="ltr"><<a href="mailto:popizdeh@gmail.com" target="_blank">popizdeh@gmail.com</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">You're absolutely right. But I'm seeing something strange now, location points to 'class A' and not 'A'. Same with fully qualified names. Has there been a recent change that did this? And more importantly are you happy with this as FriendDecl's location?</div>







<div><div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, May 9, 2014 at 9:43 AM, Richard Smith <span dir="ltr"><<a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</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 class="gmail_extra">Can you use TSI->getTypeLoc().getLocStart() instead of wiring through a new SourceLocation?<div>








<div><br><br><div class="gmail_quote">On Thu, May 8, 2014 at 4:37 PM, Nikola Smiljanic <span dir="ltr"><<a href="mailto:popizdeh@gmail.com" target="_blank">popizdeh@gmail.com</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">Nudge nudge :)</div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Tue, Apr 29, 2014 at 5:35 PM, Manuel Klimek <span dir="ltr"><<a href="mailto:klimek@google.com" target="_blank">klimek@google.com</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">+richard<div><br></div><div>This makes sense to me, but I don't understand the code well enough to approve... Looping in Richard for an expert opinion ;)</div>











</div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Tue, Apr 29, 2014 at 5:13 AM, Nikola Smiljanic <span dir="ltr"><<a href="mailto:popizdeh@gmail.com" target="_blank">popizdeh@gmail.com</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">Ping.<div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Apr 16, 2014 at 8:38 PM, Nikola Smiljanic <span dir="ltr"><<a href="mailto:popizdeh@gmail.com" target="_blank">popizdeh@gmail.com</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">LocStart in CheckFriendTypeDecl is the start of DeclSpec range. This is OK for checking that declaration starts with 'friend' keyword but is redundant when it comes to FriendDecl creation. Location of the keyword is already passed as FriendLoc.<div>
















<br></div><div>I've added another parameter to this function that points to location of the type from the declaration. The call to CheckFriendTypeDecl from SemaTemplateInstantiateDecl now isn't technically correct because it's passing the the type location as LocStart. But the error that's checked for using this parameter can only happen inside class declaration, not instantiated template, I think :)</div>
















<div><br></div><div>Is there a way to test this? I'm not seeing any regressions.</div><div><br></div><div>struct A{};</div><div>typedef A Atypedef;</div><div><br></div><div>namespace ns { struct B{}; }</div><div><br>















</div>
<div>template <typename T></div><div>class C</div><div>{</div><div>friend class A; // points to A</div><div>friend Atypedef; // points to Atypedef</div><div>friend T; //  points to T</div><div>friend decltype(whatever); // points to decltype</div>
















<div>friend ns::B; // points to B</div><div>friend typename T::something; // points to something</div><div>}</div></div>
</blockquote></div><br></div></div></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div></div></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>