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,13 +368,16 @@ 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();
if (paramDecls.length > i) { // This will be less than i if we have a void parameter
temp = paramDecls[i];
IASTName n = temp.getDeclarator().getName(); IASTName n = temp.getDeclarator().getName();
if( n != name ) { if( n != name ) {
n.setBinding( binding ); n.setBinding( binding );
((CPPParameter)binding).addDeclaration( n ); ((CPPParameter)binding).addDeclaration( n );
} }
} }
}
if( declarations != null ){ if( declarations != null ){
for( int j = 0; j < declarations.length && declarations[j] != null; j++ ){ for( int j = 0; j < declarations.length && declarations[j] != null; j++ ){
IASTParameterDeclaration [] paramDecls = declarations[j].getParameters(); IASTParameterDeclaration [] paramDecls = declarations[j].getParameters();