From b7caba9dd2c3d4867247af4627dd73c2158066ae Mon Sep 17 00:00:00 2001 From: Andrew Niefer Date: Wed, 23 Mar 2005 15:33:57 +0000 Subject: [PATCH] Patch from Devin Steffler --- .../cdt/core/parser/tests/ast2/AST2UtilTests.java | 2 +- .../org/eclipse/cdt/core/dom/ast/ASTTypeUtil.java | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2UtilTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2UtilTests.java index 016452796d7..6066501301f 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2UtilTests.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2UtilTests.java @@ -132,7 +132,7 @@ public class AST2UtilTests extends AST2BaseTest { // verify types isTypeEqual( ((IASTTypeIdExpression)((IASTInitializerExpression)((IASTSimpleDeclaration)d[0]).getDeclarators()[0].getInitializer()).getExpression()).getTypeId(), "int"); //$NON-NLS-1$ - isTypeEqual( ((IASTTypeIdExpression)((IASTReturnStatement)((IASTCompoundStatement)((IASTFunctionDefinition)d[2]).getBody()).getStatements()[0]).getReturnValue()).getTypeId(), "union"); //$NON-NLS-1$ + isTypeEqual( ((IASTTypeIdExpression)((IASTReturnStatement)((IASTCompoundStatement)((IASTFunctionDefinition)d[2]).getBody()).getStatements()[0]).getReturnValue()).getTypeId(), "union Squaw"); //$NON-NLS-1$ isTypeEqual( ((IASTCastExpression)((IASTInitializerExpression)((IASTSimpleDeclaration)d[6]).getDeclarators()[0].getInitializer()).getExpression()).getTypeId() , "short"); //$NON-NLS-1$ } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTTypeUtil.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTTypeUtil.java index 438f7324f7b..7515f268c1f 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTTypeUtil.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTTypeUtil.java @@ -29,8 +29,10 @@ import org.eclipse.cdt.internal.core.dom.parser.ITypeContainer; import org.eclipse.cdt.internal.core.dom.parser.c.CASTTypeId; import org.eclipse.cdt.internal.core.dom.parser.c.CExternalFunction; import org.eclipse.cdt.internal.core.dom.parser.c.CExternalVariable; +import org.eclipse.cdt.internal.core.dom.parser.c.CStructure; import org.eclipse.cdt.internal.core.dom.parser.c.CVisitor; import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTTypeId; +import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPClassType; import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPVisitor; /** @@ -202,6 +204,14 @@ public class ASTTypeUtil { } } catch (DOMException e) {} + if (type instanceof CStructure) { + result.append(SPACE); + result.append(((CStructure)type).getName()); + } + if (type instanceof CPPClassType) { + result.append(SPACE); + result.append(((CPPClassType)type).getName()); + } } else if (type instanceof ICPPReferenceType) { result.append(Keywords.cpAMPER); } else if (type instanceof ICPPTemplateTypeParameter) {