<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 style>you didn't update CheckFriendTypeDecl or any of its callers. CheckFriendTypeDecl does this: <br>

</div><div style><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><br></div><div>Nick<br><div class="gmail_extra"><br><div class="gmail_quote">On 31 January 2013 01:54, Enea Zaffanella <span dir="ltr"><<a href="mailto:zaffanella@cs.unipr.it" target="_blank">zaffanella@cs.unipr.it</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Author: enea<br>
Date: Thu Jan 31 03:54:08 2013<br>
New Revision: 174050<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=174050&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=174050&view=rev</a><br>
Log:<br>
Added outer template parameter lists to friend type AST nodes.<br>
<br>
Modified:<br>
    cfe/trunk/include/clang/AST/DeclFriend.h<br>
    cfe/trunk/lib/AST/DeclFriend.cpp<br>
    cfe/trunk/lib/AST/DeclPrinter.cpp<br>
    cfe/trunk/lib/Sema/SemaDeclCXX.cpp<br>
    cfe/trunk/lib/Serialization/ASTReaderDecl.cpp<br>
    cfe/trunk/lib/Serialization/ASTWriterDecl.cpp<br></blockquote><div><br></div></div></div></div></div>