<div dir="ltr">On 5 February 2013 20:31, Nick Lewycky <span dir="ltr"><<a href="mailto:nlewycky@google.com" target="_blank">nlewycky@google.com</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"><div dir="ltr">Hi Enea! This introduced a regression. I've attached an updated testcase to go into clang, but the affected code looks like:<div>

<br></div><div><div>  template<typename T> class B;</div><div>  </div>
<div>  template <typename T><br></div><div>  class A {</div><div>    template<typename S> friend class B<S>::ty;</div><div>  };</div><div>  template <typename T> class B {</div><div>    struct ty {};</div>


<div>  };</div><div>  </div><div>  void test() {</div><div>    (void)sizeof(A<int>);</div><div>  }</div></div><div><br></div><div>you didn't update CheckFriendTypeDecl or any of its callers. CheckFriendTypeDecl does this: <br>


</div><div><br></div>  // C++11 [class.friend]p3:<div>  // A friend declaration that does not declare a function shall have one</div><div>  // of the following forms:</div><div>  // friend elaborated-type-specifier ;</div>


<div>  // friend simple-type-specifier ;</div><div>  // friend typename-specifier ;</div><div>  if (getLangOpts().CPlusPlus11 && LocStart != FriendLoc)</div><div>    Diag(FriendLoc, diag::err_friend_not_first_in_declaration) << T;</div>


<div><br></div><div>what happens is that LocStart now starts at the "template" keyword while the FriendLoc is the "friend" keyword.</div><div><br></div><div>I'm going to try fixing it tonight, but if I can't then I might have to revert it temporarily and please resubmit when you have this bug fixed.</div>

</div></blockquote><div><br></div><div style>I committed the fix in r174486. Please take a look, and let me know if you have any review comments!</div><div style><br></div><div style>Nick</div><div><br></div></div></div>
</div>