1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00
This commit is contained in:
John Camelon 2004-05-26 01:11:00 +00:00
parent 285254ad4e
commit 895266aebe
2 changed files with 25 additions and 1 deletions

View file

@ -262,4 +262,17 @@ public class SelectionParseTest extends SelectionParseBaseTest {
IASTMethod constructor = (IASTMethod) node;
assertTrue( constructor.isConstructor() );
}
public void testBug63966() throws Exception
{
Writer writer = new StringWriter();
writer.write( "void foo(int a) {}\n" ); //$NON-NLS-1$
writer.write( "void foo(long a) {}\n" ); //$NON-NLS-1$
writer.write( "int main(int argc, char **argv) {\n" ); //$NON-NLS-1$
writer.write( "foo(1); \n }" ); //$NON-NLS-1$
String code = writer.toString();
int startIndex = code.indexOf( "foo(1)"); //$NON-NLS-1$
IASTNode node = parse( code, startIndex, startIndex + 3 );
}
}

View file

@ -118,7 +118,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
static
{
SUBSCRIPT = new ArrayList();
SUBSCRIPT = new ArrayList(1);
SUBSCRIPT.add( TypeInfo.OperatorExpression.subscript );
}
@ -3456,6 +3456,17 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
return null;
}
}
else if( expression.getExpressionKind() == Kind.POSTFIX_FUNCTIONCALL )
{
try {
ISymbol symbol = getExpressionSymbol( scope, expression.getExpressionKind(), expression.getLHSExpression(), expression.getRHSExpression(), null, null );
return symbol.getASTExtension().getPrimaryDeclaration();
} catch (ASTSemanticException e) {
return null;
}
}
else
{