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

org.eclipse.cdt.core

Fixed https://bugs.eclipse.org/bugs/show_bug.cgi?id=54029

org.eclipse.cdt.core.tests
	Added CompleteParseASTTest::testBug54029().
This commit is contained in:
John Camelon 2004-04-05 04:25:33 +00:00
parent 91571bd2e5
commit 8a6680ea21
3 changed files with 20 additions and 1 deletions

View file

@ -1374,4 +1374,20 @@ public class CompleteParseASTTest extends CompleteParseBaseTest
assertFalse( j.hasNext() );
assertEquals( data.getName(), "data" );
}
public void testBug54029() throws Exception
{
Iterator i = parse( "typedef int T; T i;" ).getDeclarations();
IASTTypedefDeclaration typedef = (IASTTypedefDeclaration) i.next();
assertEquals( typedef.getName(), "T");
assertTrue( typedef.getAbstractDeclarator().getTypeSpecifier() instanceof IASTSimpleTypeSpecifier );
assertEquals( ((IASTSimpleTypeSpecifier)typedef.getAbstractDeclarator().getTypeSpecifier()).getType(), IASTSimpleTypeSpecifier.Type.INT );
IASTVariable variable = (IASTVariable) i.next();
assertFalse( i.hasNext() );
assertEquals( variable.getName(), "i");
assertEquals( ((IASTSimpleTypeSpecifier)variable.getAbstractDeclaration().getTypeSpecifier()).getTypename(), "T" );
assertNotNull( ((IASTSimpleTypeSpecifier)variable.getAbstractDeclaration().getTypeSpecifier()).getTypeSpecifier() );
assertEquals( ((IASTSimpleTypeSpecifier)variable.getAbstractDeclaration().getTypeSpecifier()).getTypeSpecifier(), typedef );
}
}

View file

@ -1,3 +1,6 @@
2004-04-05 John Camelon
Fixed https://bugs.eclipse.org/bugs/show_bug.cgi?id=54029
2004-04-04 John Camelon
Fixed https://bugs.eclipse.org/bugs/show_bug.cgi?id=56516
Fixed https://bugs.eclipse.org/bugs/show_bug.cgi?id=53786

View file

@ -15,7 +15,7 @@ package org.eclipse.cdt.core.parser.ast;
* @author jcamelon
*
*/
public interface IASTTypedefDeclaration extends IASTDeclaration, IASTOffsetableNamedElement, IASTQualifiedNameElement {
public interface IASTTypedefDeclaration extends IASTDeclaration, IASTOffsetableNamedElement, IASTQualifiedNameElement, IASTTypeSpecifier {
public String getName();
public IASTAbstractDeclaration getAbstractDeclarator();