diff --git a/core/org.eclipse.cdt.core.tests/ChangeLog b/core/org.eclipse.cdt.core.tests/ChangeLog index cbed9e1e479..de66c6f4451 100644 --- a/core/org.eclipse.cdt.core.tests/ChangeLog +++ b/core/org.eclipse.cdt.core.tests/ChangeLog @@ -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. diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTTest.java index 974eb457706..4a7462d542f 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTTest.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTTest.java @@ -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() ); + } } diff --git a/core/org.eclipse.cdt.core/parser/ChangeLog b/core/org.eclipse.cdt.core/parser/ChangeLog index f90db025438..ce871b1560f 100644 --- a/core/org.eclipse.cdt.core/parser/ChangeLog +++ b/core/org.eclipse.cdt.core/parser/ChangeLog @@ -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. diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/CompleteParseASTFactory.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/CompleteParseASTFactory.java index 5c21f7b35d7..1909745e98e 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/CompleteParseASTFactory.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/CompleteParseASTFactory.java @@ -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) {