mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Patch for Andrew Niefer
CompleteParseASTFactory should use the symbol table's elaboratedLookup instead of qualifiedLookup when it encounters an elaborated type specifier. Core: change createElaboratedTypeSpecifier to call IContainerSymbol.elaboratedLookup Core.tests add CompleteParseASTTest.testBug47624
This commit is contained in:
parent
0adb9b9d20
commit
21f4465862
4 changed files with 26 additions and 1 deletions
|
@ -5,6 +5,9 @@
|
|||
ParserSymbolTableTest.testPrefixLookup_Qualified
|
||||
ParserSymbolTableTest.testPrefixLookup_Inheritance
|
||||
|
||||
2003-11-27 Andrew Niefer
|
||||
add CompleteParseASTTest.testBug47624()
|
||||
|
||||
2003-11-18 Andrew Niefer
|
||||
update ParserSymbolTableTest to reflect refactoring of Declaration into 4 separate classes.
|
||||
|
||||
|
|
|
@ -1055,4 +1055,23 @@ public class CompleteParseASTTest extends CompleteParseBaseTest
|
|||
assertFalse(i.hasNext());
|
||||
}
|
||||
|
||||
public void testBug47624() throws Exception
|
||||
{
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
buffer.append( "struct s { }; \n" );
|
||||
buffer.append( "void f ( int s ) { \n" );
|
||||
buffer.append( " struct s sInstance; \n" );
|
||||
buffer.append( "}\n");
|
||||
|
||||
Iterator i = parse( buffer.toString() ).getDeclarations();
|
||||
IASTClassSpecifier structS = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier();
|
||||
IASTFunction function = (IASTFunction) i.next();
|
||||
Iterator fnIter = getDeclarations( function );
|
||||
IASTVariable sInstance = (IASTVariable) fnIter.next();
|
||||
IASTElaboratedTypeSpecifier elaborated = (IASTElaboratedTypeSpecifier) sInstance.getAbstractDeclaration().getTypeSpecifier();
|
||||
assertFalse( fnIter.hasNext() );
|
||||
|
||||
assertAllReferences( 1, createTaskList( new Task( structS ) ) );
|
||||
assertFalse( i.hasNext() );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
2003-11-27 Andrew Niefer
|
||||
fix bug 47264: Parse fails when using struct s foo; and int s; in function bodies
|
||||
|
||||
2003-11-18 Andrew Niefer
|
||||
Refactor PST: Split Declaration into 4 classes : ContainerSymbol, DerivableContainerSymbol, ParameterizedContainerSymbol,
|
||||
SpecializedSymbol. Move these along with BasicSymbol & TemplateInstance to no longer be nested in ParserSymbolTable.
|
||||
|
|
|
@ -2484,7 +2484,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
|
|||
ISymbol checkSymbol = null;
|
||||
try
|
||||
{
|
||||
checkSymbol = currentScopeSymbol.qualifiedLookup(lastToken.getImage());
|
||||
checkSymbol = currentScopeSymbol.elaboratedLookup( pstType, lastToken.getImage());
|
||||
}
|
||||
catch (ParserSymbolTableException e)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue