mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Partial fix for https://bugs.eclipse.org/bugs/show_bug.cgi?id=63966
This commit is contained in:
parent
285254ad4e
commit
895266aebe
2 changed files with 25 additions and 1 deletions
|
@ -262,4 +262,17 @@ public class SelectionParseTest extends SelectionParseBaseTest {
|
||||||
IASTMethod constructor = (IASTMethod) node;
|
IASTMethod constructor = (IASTMethod) node;
|
||||||
assertTrue( constructor.isConstructor() );
|
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 );
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -118,7 +118,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
|
||||||
|
|
||||||
static
|
static
|
||||||
{
|
{
|
||||||
SUBSCRIPT = new ArrayList();
|
SUBSCRIPT = new ArrayList(1);
|
||||||
SUBSCRIPT.add( TypeInfo.OperatorExpression.subscript );
|
SUBSCRIPT.add( TypeInfo.OperatorExpression.subscript );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3456,6 +3456,17 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
|
||||||
return null;
|
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
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue