mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
org.eclipse.cdt.core<BR>
Fixed https://bugs.eclipse.org/bugs/show_bug.cgi?id=57800.<BR><BR> org.eclipse.cdt.core.tests<BR> Removed warnings from CompletionTests.<BR> Added CompleteParseASTTest::testBug57800().<BR>
This commit is contained in:
parent
3980981b94
commit
1ac6f78fc3
7 changed files with 33 additions and 10 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
2004-04-08 John Camelon
|
||||||
|
Removed warnings from CompletionTests.
|
||||||
|
Added CompleteParseASTTest::testBug57800().
|
||||||
|
|
||||||
2004-04-07 Andrew Niefer
|
2004-04-07 Andrew Niefer
|
||||||
added CompletionParseTest.testCompletionWithTemplateInstanceAsParent()
|
added CompletionParseTest.testCompletionWithTemplateInstanceAsParent()
|
||||||
|
|
||||||
|
|
|
@ -1411,4 +1411,21 @@ public class CompleteParseASTTest extends CompleteParseBaseTest
|
||||||
|
|
||||||
assertAllReferences( 2, createTaskList( new Task( outerS ), new Task( innerS ) ) );
|
assertAllReferences( 2, createTaskList( new Task( outerS ), new Task( innerS ) ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testBug57800() throws Exception
|
||||||
|
{
|
||||||
|
Writer writer= new StringWriter();
|
||||||
|
writer.write( "class G2 { int j; };");
|
||||||
|
writer.write( "typedef G2 AltG2;");
|
||||||
|
writer.write( "class AltG3 : AltG2 { int x;};");
|
||||||
|
Iterator i = parse( writer.toString() ).getDeclarations();
|
||||||
|
IASTClassSpecifier G2 = (IASTClassSpecifier) ((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier();
|
||||||
|
IASTTypedefDeclaration AltG2 = (IASTTypedefDeclaration) i.next();
|
||||||
|
IASTClassSpecifier AltG3 = (IASTClassSpecifier) ((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier();
|
||||||
|
assertFalse( i.hasNext() );
|
||||||
|
Iterator baseClauses = AltG3.getBaseClauses();
|
||||||
|
IASTBaseSpecifier baseClause = (IASTBaseSpecifier) baseClauses.next();
|
||||||
|
assertFalse( baseClauses.hasNext() );
|
||||||
|
baseClause.getParentClassSpecifier();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -734,7 +734,6 @@ public class CompletionParseTest extends CompleteParseBaseTest {
|
||||||
assertEquals( result.getResultsSize(), matches.size() );
|
assertEquals( result.getResultsSize(), matches.size() );
|
||||||
|
|
||||||
Iterator iter = result.getNodes();
|
Iterator iter = result.getNodes();
|
||||||
int assertionCount = 0;
|
|
||||||
while( iter.hasNext() )
|
while( iter.hasNext() )
|
||||||
{
|
{
|
||||||
IASTOffsetableNamedElement element = (IASTOffsetableNamedElement) iter.next();
|
IASTOffsetableNamedElement element = (IASTOffsetableNamedElement) iter.next();
|
||||||
|
@ -746,7 +745,6 @@ public class CompletionParseTest extends CompleteParseBaseTest {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
protected IASTCompilationUnit getCompilationUnit() {
|
protected IASTCompilationUnit getCompilationUnit() {
|
||||||
CompleteParseBaseTest.Scope s = (Scope) callback.getCompilationUnit();
|
|
||||||
IASTCompilationUnit compilationUnit = (IASTCompilationUnit) ((Scope) callback.getCompilationUnit()).getScope();
|
IASTCompilationUnit compilationUnit = (IASTCompilationUnit) ((Scope) callback.getCompilationUnit()).getScope();
|
||||||
return compilationUnit;
|
return compilationUnit;
|
||||||
}
|
}
|
||||||
|
@ -826,8 +824,9 @@ public class CompletionParseTest extends CompleteParseBaseTest {
|
||||||
|
|
||||||
Iterator i = result.getNodes();
|
Iterator i = result.getNodes();
|
||||||
|
|
||||||
IASTField bmember = (IASTField) i.next();
|
assertTrue( i.next() instanceof IASTField );
|
||||||
IASTField amember = (IASTField) i.next();
|
assertTrue( i.next() instanceof IASTField );
|
||||||
|
assertFalse( i.hasNext() );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
2004-04-08 John Camelon
|
||||||
|
Fixed https://bugs.eclipse.org/bugs/show_bug.cgi?id=57800.
|
||||||
|
|
||||||
2004-04-07 John Camelon
|
2004-04-07 John Camelon
|
||||||
Fixed https://bugs.eclipse.org/bugs/show_bug.cgi?id=50808.
|
Fixed https://bugs.eclipse.org/bugs/show_bug.cgi?id=50808.
|
||||||
Provided partial fix for https://bugs.eclipse.org/bugs/show_bug.cgi?id=50807.
|
Provided partial fix for https://bugs.eclipse.org/bugs/show_bug.cgi?id=50807.
|
||||||
|
|
|
@ -22,7 +22,7 @@ public interface IASTBaseSpecifier extends ISourceElementCallbackDelegate {
|
||||||
public ASTAccessVisibility getAccess();
|
public ASTAccessVisibility getAccess();
|
||||||
public boolean isVirtual();
|
public boolean isVirtual();
|
||||||
public String getParentClassName();
|
public String getParentClassName();
|
||||||
public IASTClassSpecifier getParentClassSpecifier() throws ASTNotImplementedException;
|
public IASTTypeSpecifier getParentClassSpecifier() throws ASTNotImplementedException;
|
||||||
public int getNameOffset();
|
public int getNameOffset();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@ import java.util.List;
|
||||||
import org.eclipse.cdt.core.parser.ISourceElementRequestor;
|
import org.eclipse.cdt.core.parser.ISourceElementRequestor;
|
||||||
import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility;
|
import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility;
|
||||||
import org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier;
|
import org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier;
|
||||||
import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier;
|
import org.eclipse.cdt.core.parser.ast.IASTTypeSpecifier;
|
||||||
import org.eclipse.cdt.internal.core.parser.pst.ISymbol;
|
import org.eclipse.cdt.internal.core.parser.pst.ISymbol;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -67,9 +67,9 @@ public class ASTBaseSpecifier implements IASTBaseSpecifier
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier#getParentClassSpecifier()
|
* @see org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier#getParentClassSpecifier()
|
||||||
*/
|
*/
|
||||||
public IASTClassSpecifier getParentClassSpecifier()
|
public IASTTypeSpecifier getParentClassSpecifier()
|
||||||
{
|
{
|
||||||
return (IASTClassSpecifier)symbol.getASTExtension().getPrimaryDeclaration();
|
return (IASTTypeSpecifier)symbol.getASTExtension().getPrimaryDeclaration();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
|
|
|
@ -14,8 +14,8 @@ import org.eclipse.cdt.core.parser.ISourceElementRequestor;
|
||||||
import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility;
|
import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility;
|
||||||
import org.eclipse.cdt.core.parser.ast.ASTNotImplementedException;
|
import org.eclipse.cdt.core.parser.ast.ASTNotImplementedException;
|
||||||
import org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier;
|
import org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier;
|
||||||
import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier;
|
|
||||||
import org.eclipse.cdt.core.parser.ast.IASTReference;
|
import org.eclipse.cdt.core.parser.ast.IASTReference;
|
||||||
|
import org.eclipse.cdt.core.parser.ast.IASTTypeSpecifier;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author jcamelon
|
* @author jcamelon
|
||||||
|
@ -58,7 +58,7 @@ public class ASTBaseSpecifier implements IASTBaseSpecifier {
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier#getParentClassSpecifier()
|
* @see org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier#getParentClassSpecifier()
|
||||||
*/
|
*/
|
||||||
public IASTClassSpecifier getParentClassSpecifier() throws ASTNotImplementedException
|
public IASTTypeSpecifier getParentClassSpecifier() throws ASTNotImplementedException
|
||||||
{
|
{
|
||||||
throw new ASTNotImplementedException();
|
throw new ASTNotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue