aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDeclCXX.cpp
diff options
context:
space:
mode:
authorAbramo Bagnara <abramo.bagnara@gmail.com>2011-03-18 15:16:37 +0000
committerAbramo Bagnara <abramo.bagnara@gmail.com>2011-03-18 15:16:37 +0000
commit7f0a915eb546d353071be08c8adec155e5d9a0dc (patch)
tree695a7a87d2f72f72da5891709654603b71802f58 /lib/Sema/SemaDeclCXX.cpp
parenta9d129329b36660417af8f43fd5dfc75d9a5f0a1 (diff)
Fixed inconsistency when adding TemplateParameterListsInfo.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127876 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclCXX.cpp')
-rw-r--r--lib/Sema/SemaDeclCXX.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp
index 430f9c8052..858a5f9251 100644
--- a/lib/Sema/SemaDeclCXX.cpp
+++ b/lib/Sema/SemaDeclCXX.cpp
@@ -6977,7 +6977,6 @@ Decl *Sema::ActOnTemplatedFriendTag(Scope *S, SourceLocation FriendLoc,
TagTypeKind Kind = TypeWithKeyword::getTagTypeKindForTypeSpec(TagSpec);
bool isExplicitSpecialization = false;
- unsigned NumMatchedTemplateParamLists = TempParamLists.size();
bool Invalid = false;
if (TemplateParameterList *TemplateParams
@@ -6987,8 +6986,6 @@ Decl *Sema::ActOnTemplatedFriendTag(Scope *S, SourceLocation FriendLoc,
/*friend*/ true,
isExplicitSpecialization,
Invalid)) {
- --NumMatchedTemplateParamLists;
-
if (TemplateParams->size() > 0) {
// This is a declaration of a class template.
if (Invalid)
@@ -6997,7 +6994,7 @@ Decl *Sema::ActOnTemplatedFriendTag(Scope *S, SourceLocation FriendLoc,
return CheckClassTemplate(S, TagSpec, TUK_Friend, TagLoc,
SS, Name, NameLoc, Attr,
TemplateParams, AS_public,
- NumMatchedTemplateParamLists,
+ TempParamLists.size() - 1,
(TemplateParameterList**) TempParamLists.release()).take();
} else {
// The "template<>" header is extraneous.
@@ -7012,7 +7009,7 @@ Decl *Sema::ActOnTemplatedFriendTag(Scope *S, SourceLocation FriendLoc,
assert(SS.isNotEmpty() && "valid templated tag with no SS and no direct?");
bool isAllExplicitSpecializations = true;
- for (unsigned I = 0; I != NumMatchedTemplateParamLists; ++I) {
+ for (unsigned I = TempParamLists.size(); I-- > 0; ) {
if (TempParamLists.get()[I]->size()) {
isAllExplicitSpecializations = false;
break;