mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-04 14:55:41 +02:00
Patch from Devin Steffler
This commit is contained in:
parent
e8ba635111
commit
b7caba9dd2
2 changed files with 11 additions and 1 deletions
|
@ -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$
|
||||
}
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue