summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaTemplate.cpp
diff options
context:
space:
mode:
authorNikola Smiljanic <popizdeh@gmail.com>2014-07-17 01:59:34 +0000
committerNikola Smiljanic <popizdeh@gmail.com>2014-07-17 01:59:34 +0000
commit4fc91538e93860a0b86b72530054acc301ab9c0e (patch)
tree63bfaf383e493bac3327464097d2045de093544e /clang/lib/Sema/SemaTemplate.cpp
parent354e23b029e6337eefacb28bcda0cf3bae85b635 (diff)
downloadbcm5719-llvm-4fc91538e93860a0b86b72530054acc301ab9c0e.tar.gz
bcm5719-llvm-4fc91538e93860a0b86b72530054acc301ab9c0e.zip
Fix FriendDecl source location and range for class templates and function declarations that don't start with 'friend' keyword. Add more unittests.
llvm-svn: 213220
Diffstat (limited to 'clang/lib/Sema/SemaTemplate.cpp')
-rw-r--r--clang/lib/Sema/SemaTemplate.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp
index 5a188453b4f..509103e2b5d 100644
--- a/clang/lib/Sema/SemaTemplate.cpp
+++ b/clang/lib/Sema/SemaTemplate.cpp
@@ -838,6 +838,7 @@ Sema::CheckClassTemplate(Scope *S, unsigned TagSpec, TagUseKind TUK,
AttributeList *Attr,
TemplateParameterList *TemplateParams,
AccessSpecifier AS, SourceLocation ModulePrivateLoc,
+ SourceLocation FriendLoc,
unsigned NumOuterTemplateParamLists,
TemplateParameterList** OuterTemplateParamLists) {
assert(TemplateParams && TemplateParams->size() > 0 &&
@@ -1123,10 +1124,8 @@ Sema::CheckClassTemplate(Scope *S, unsigned TagSpec, TagUseKind TUK,
/* AddToContext = */ false);
}
- FriendDecl *Friend = FriendDecl::Create(Context, CurContext,
- NewClass->getLocation(),
- NewTemplate,
- /*FIXME:*/NewClass->getLocation());
+ FriendDecl *Friend = FriendDecl::Create(
+ Context, CurContext, NewClass->getLocation(), NewTemplate, FriendLoc);
Friend->setAccess(AS_public);
CurContext->addDecl(Friend);
}
@@ -6123,6 +6122,7 @@ Sema::ActOnClassTemplateSpecialization(Scope *S, unsigned TagSpec,
Attr,
TemplateParams,
AS_none, /*ModulePrivateLoc=*/SourceLocation(),
+ /*FriendLoc*/SourceLocation(),
TemplateParameterLists.size() - 1,
TemplateParameterLists.data());
}
OpenPOWER on IntegriCloud