]> granicus.if.org Git - clang/commitdiff
PR19352 - getLocation() points to the wrong position for FriendDecls
authorNikola Smiljanic <popizdeh@gmail.com>
Fri, 23 May 2014 12:48:27 +0000 (12:48 +0000)
committerNikola Smiljanic <popizdeh@gmail.com>
Fri, 23 May 2014 12:48:27 +0000 (12:48 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209511 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaDeclCXX.cpp

index 425c0f6bc6a1f2e1761614413f2ce6063101317e..2930d30752840be267c7089662f4aa82bf5c0938 100644 (file)
@@ -11425,7 +11425,9 @@ FriendDecl *Sema::CheckFriendTypeDecl(SourceLocation LocStart,
   //   If the type specifier in a friend declaration designates a (possibly
   //   cv-qualified) class type, that class is declared as a friend; otherwise,
   //   the friend declaration is ignored.
-  return FriendDecl::Create(Context, CurContext, LocStart, TSInfo, FriendLoc);
+  return FriendDecl::Create(Context, CurContext,
+                            TSInfo->getTypeLoc().getLocStart(), TSInfo,
+                            FriendLoc);
 }
 
 /// Handle a friend tag declaration where the scope specifier was