<div dir="ltr">Ping.<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>