diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java index e2e77da4291..aae2bea0a5c 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java @@ -3549,5 +3549,19 @@ public class AST2CPPTests extends AST2BaseTest { assertTrue( I8.getType() instanceof IBasicType ); assertEquals( ((IBasicType)I8.getType()).getType(), IBasicType.t_char ); } + + public void testBug90623_2() throws Exception { + StringBuffer buffer = new StringBuffer(); + buffer.append( "typedef int I; \n"); //$NON-NLS-1$ + buffer.append( "void f11( I i ); \n"); //$NON-NLS-1$ + buffer.append( "void main(){ f a; } \n"); //$NON-NLS-1$ + + IASTTranslationUnit tu = parse( buffer.toString(), ParserLanguage.CPP ); //$NON-NLS-1$ + CPPNameCollector col = new CPPNameCollector(); + tu.accept( col ); + + IASTName f = col.getName( 5 ); + f.resolvePrefix(); + } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPSemantics.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPSemantics.java index 15410719ae6..3db874d9f54 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPSemantics.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPSemantics.java @@ -1324,9 +1324,11 @@ public class CPPSemantics { if( bindings == null || bindings.length == 0 ) return null; else if( bindings.length == 1 ){ - if( bindings[0] instanceof IASTName ) - return ((IASTName) bindings[ 0 ]).resolveBinding(); - return (IBinding) bindings[0]; + if( bindings[0] instanceof IBinding ) + return (IBinding) bindings[0]; + else if( bindings[0] instanceof IASTName && ((IASTName) bindings[0]).getBinding() != null ) + return ((IASTName) bindings[ 0 ]).getBinding(); + } if( name.getPropertyInParent() != STRING_LOOKUP_PROPERTY ) { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTypedef.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTypedef.java index 24068f6762b..076ea4023be 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTypedef.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTypedef.java @@ -99,12 +99,12 @@ public class CPPTypedef implements ITypedef, ITypeContainer, ICPPInternalBinding public IType getType() { if( type == null ){ type = CPPVisitor.createType( (IASTDeclarator) typedefName.getParent() ); - if( type instanceof ITypedef ){ - try { - type = ((ITypedef)type).getType(); - } catch ( DOMException e ) { - } - } +// if( type instanceof ITypedef ){ +// try { +// type = ((ITypedef)type).getType(); +// } catch ( DOMException e ) { +// } +// } } return type; }