forked from OSchip/llvm-project
[Sema] Allocate SmallVector to the right size.
SmallVector::set_size does not reallocate the vector. Sadly I have no idea how to test this. The vector never has more than one member in all of the regression tests. Found by inspection. llvm-svn: 243987
This commit is contained in:
parent
2f12b2ede5
commit
9dc549b1dd
|
@ -1657,7 +1657,7 @@ TemplateDeclInstantiator::VisitCXXMethodDecl(CXXMethodDecl *D,
|
|||
SmallVector<TemplateParameterList *, 4> TempParamLists;
|
||||
unsigned NumTempParamLists = 0;
|
||||
if (isFriend && (NumTempParamLists = D->getNumTemplateParameterLists())) {
|
||||
TempParamLists.set_size(NumTempParamLists);
|
||||
TempParamLists.resize(NumTempParamLists);
|
||||
for (unsigned I = 0; I != NumTempParamLists; ++I) {
|
||||
TemplateParameterList *TempParams = D->getTemplateParameterList(I);
|
||||
TemplateParameterList *InstParams = SubstTemplateParams(TempParams);
|
||||
|
|
Loading…
Reference in New Issue