1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 22:52:11 +02:00

Bug 142713 - For some reason the number of template parameters in this code was smaller than expected. Could be due to some unimplemented methods in the PDOM, but I'm not sure of that. At any rate, I've added a check to skip over the tempate if the number of parameters wasn't large enough.

This commit is contained in:
Doug Schaefer 2006-05-25 03:24:38 +00:00
parent ce45b4750e
commit f721770c5e

View file

@ -199,18 +199,20 @@ public abstract class CPPTemplateDefinition extends PlatformObject implements IC
else
binding = new CPPTemplateTemplateParameter( name );
ICPPASTTemplateParameter temp = null;
ICPPASTTemplateDeclaration template = null;
int length = ( declarations != null ) ? declarations.length : 0;
int j = ( definition != null ) ? -1 : 0;
for( ; j < length; j++ ){
template = ( j == -1 ) ? CPPTemplates.getTemplateDeclaration( definition )
ICPPASTTemplateDeclaration template = ( j == -1 )
? CPPTemplates.getTemplateDeclaration( definition )
: CPPTemplates.getTemplateDeclaration( declarations[j] );
if( template == null )
continue;
temp = template.getTemplateParameters()[i];
IASTName n = CPPTemplates.getTemplateParameterName( temp );
ICPPASTTemplateParameter[] temp = template.getTemplateParameters();
if (temp.length <= i)
continue;
IASTName n = CPPTemplates.getTemplateParameterName(temp[i]);
if( n != null && n != name && n.getBinding() == null ) {
n.setBinding( binding );
if( binding instanceof ICPPInternalBinding )