<p>Test case? Perhaps using the c-index-test annotate tokens feature? </p>
<div class="gmail_quote">On Oct 29, 2011 2:00 PM, "Abramo Bagnara" <<a href="mailto:abramo.bagnara@gmail.com">abramo.bagnara@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Author: abramo<br>
Date: Sat Oct 29 15:52:52 2011<br>
New Revision: 143295<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=143295&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=143295&view=rev</a><br>
Log:<br>
Fixed FriendDecl source locations.<br>
<br>
Modified:<br>
    cfe/trunk/include/clang/Sema/Sema.h<br>
    cfe/trunk/lib/Sema/SemaDeclCXX.cpp<br>
    cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp<br>
<br>
Modified: cfe/trunk/include/clang/Sema/Sema.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=143295&r1=143294&r2=143295&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=143295&r1=143294&r2=143295&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/include/clang/Sema/Sema.h (original)<br>
+++ cfe/trunk/include/clang/Sema/Sema.h Sat Oct 29 15:52:52 2011<br>
@@ -3611,7 +3611,8 @@<br>
                                      Expr *AssertMessageExpr,<br>
                                      SourceLocation RParenLoc);<br>
<br>
-  FriendDecl *CheckFriendTypeDecl(SourceLocation FriendLoc,<br>
+  FriendDecl *CheckFriendTypeDecl(SourceLocation Loc,<br>
+                                  SourceLocation FriendLoc,<br>
                                   TypeSourceInfo *TSInfo);<br>
   Decl *ActOnFriendTypeDecl(Scope *S, const DeclSpec &DS,<br>
                             MultiTemplateParamsArg TemplateParams);<br>
<br>
Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=143295&r1=143294&r2=143295&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=143295&r1=143294&r2=143295&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)<br>
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Sat Oct 29 15:52:52 2011<br>
@@ -9646,7 +9646,8 @@<br>
 /// \brief Perform semantic analysis of the given friend type declaration.<br>
 ///<br>
 /// \returns A friend declaration that.<br>
-FriendDecl *Sema::CheckFriendTypeDecl(SourceLocation FriendLoc,<br>
+FriendDecl *Sema::CheckFriendTypeDecl(SourceLocation Loc,<br>
+                                      SourceLocation FriendLoc,<br>
                                       TypeSourceInfo *TSInfo) {<br>
   assert(TSInfo && "NULL TypeSourceInfo for friend type declaration");<br>
<br>
@@ -9703,7 +9704,7 @@<br>
   // FIXME: C++0x has some syntactic restrictions on friend type declarations<br>
   // in [class.friend]p3 that we do not implement.<br>
<br>
-  return FriendDecl::Create(Context, CurContext, FriendLoc, TSInfo, FriendLoc);<br>
+  return FriendDecl::Create(Context, CurContext, Loc, TSInfo, FriendLoc);<br>
 }<br>
<br>
 /// Handle a friend tag declaration where the scope specifier was<br>
@@ -9900,7 +9901,7 @@<br>
                                    TSI,<br>
                                    DS.getFriendSpecLoc());<br>
   else<br>
-    D = CheckFriendTypeDecl(DS.getFriendSpecLoc(), TSI);<br>
+    D = CheckFriendTypeDecl(Loc, DS.getFriendSpecLoc(), TSI);<br>
<br>
   if (!D)<br>
     return 0;<br>
<br>
Modified: cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp?rev=143295&r1=143294&r2=143295&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp?rev=143295&r1=143294&r2=143295&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp (original)<br>
+++ cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp Sat Oct 29 15:52:52 2011<br>
@@ -552,7 +552,8 @@<br>
     if (!InstTy)<br>
       return 0;<br>
<br>
-    FriendDecl *FD = SemaRef.CheckFriendTypeDecl(D->getFriendLoc(), InstTy);<br>
+    FriendDecl *FD = SemaRef.CheckFriendTypeDecl(D->getLocation(),<br>
+                                                 D->getFriendLoc(), InstTy);<br>
     if (!FD)<br>
       return 0;<br>
<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div>