1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Bug 164972 - Fix handling when f(void) is used in a decl and f() in the def.

This commit is contained in:
Doug Schaefer 2006-11-17 15:59:44 +00:00
parent 59dd370291
commit 46903cc52f

View file

@ -368,11 +368,14 @@ public class CPPFunction extends PlatformObject implements ICPPFunction, ICPPInt
binding = new CPPParameter( name ); binding = new CPPParameter( name );
IASTParameterDeclaration temp = null; IASTParameterDeclaration temp = null;
if( definition != null ){ if( definition != null ){
temp = definition.getParameters()[i]; IASTParameterDeclaration[] paramDecls = definition.getParameters();
IASTName n = temp.getDeclarator().getName(); if (paramDecls.length > i) { // This will be less than i if we have a void parameter
if( n != name ) { temp = paramDecls[i];
n.setBinding( binding ); IASTName n = temp.getDeclarator().getName();
((CPPParameter)binding).addDeclaration( n ); if( n != name ) {
n.setBinding( binding );
((CPPParameter)binding).addDeclaration( n );
}
} }
} }
if( declarations != null ){ if( declarations != null ){