Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJohn Camelon2005-03-14 20:24:33 +0000
committerJohn Camelon2005-03-14 20:24:33 +0000
commit44ccc9fdac9cc8e2d53498fd9c1c747963ff807b (patch)
treea5a850a13052cf7a2304679a916114bfff8241b9 /core
parentf83e7a7c6f9d3d022477493add1465371a610c32 (diff)
downloadorg.eclipse.cdt-44ccc9fdac9cc8e2d53498fd9c1c747963ff807b.tar.gz
org.eclipse.cdt-44ccc9fdac9cc8e2d53498fd9c1c747963ff807b.tar.xz
org.eclipse.cdt-44ccc9fdac9cc8e2d53498fd9c1c747963ff807b.zip
Fixed Bug 87807 - [Parser] CPPASTTypeIdExpression does not implement ICPPASTTypeIdExpression
Diffstat (limited to 'core')
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2BaseTest.java3
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2UtilOldTests.java12
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTTypeIdExpression.java4
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/GNUCPPSourceParser.java6
4 files changed, 13 insertions, 12 deletions
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2BaseTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2BaseTest.java
index c0a01f4276d..b9a6bec40bb 100644
--- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2BaseTest.java
+++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2BaseTest.java
@@ -288,7 +288,8 @@ public class AST2BaseTest extends TestCase {
protected void isExpressionStringEqual(IASTExpression exp, String str) {
- assertEquals(str, ASTSignatureUtil.getExpressionString(exp));
+ String expressionString = ASTSignatureUtil.getExpressionString(exp);
+ assertEquals(str, expressionString);
}
protected void isParameterSignatureEqual(IASTDeclarator decltor, String str) {
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2UtilOldTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2UtilOldTests.java
index b6c9847483d..b918fb82d1b 100644
--- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2UtilOldTests.java
+++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2UtilOldTests.java
@@ -163,12 +163,12 @@ public class AST2UtilOldTests extends AST2BaseTest {
isExpressionStringEqual( ((IASTInitializerExpression)((IASTSimpleDeclaration)d[0]).getDeclarators()[0].getInitializer()).getExpression(), "foo(typeid(a))" ); //$NON-NLS-1$
}
// Kind POSTFIX_TYPEID_TYPEID : type of the ID
- // TODO enable after 87807 is fixed
-// public void testPostfixTypeIdTypeId2() throws Exception{
-// IASTTranslationUnit tu = parse("int x = foo( typeid(const A) );".toString(), ParserLanguage.CPP); //$NON-NLS-1$
-// IASTDeclaration[] d = tu.getDeclarations();
-// isExpressionStringEqual( ((IASTInitializerExpression)((IASTSimpleDeclaration)d[0]).getDeclarators()[0].getInitializer()).getExpression(), "foo(typeid(const A))" ); //$NON-NLS-1$
-// }
+
+ public void testPostfixTypeIdTypeId2() throws Exception{
+ IASTTranslationUnit tu = parse("int x = foo( typeid(const A) );".toString(), ParserLanguage.CPP); //$NON-NLS-1$
+ IASTDeclaration[] d = tu.getDeclarations();
+ isExpressionStringEqual( ((IASTInitializerExpression)((IASTSimpleDeclaration)d[0]).getDeclarators()[0].getInitializer()).getExpression(), "foo(typeid (const A))" ); //$NON-NLS-1$
+ }
// Kind UNARY_INCREMENT : LHS
public void testUnaryIncrement() throws Exception
{
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTTypeIdExpression.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTTypeIdExpression.java
index 395570bd324..fc13c14432e 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTTypeIdExpression.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTTypeIdExpression.java
@@ -12,13 +12,13 @@ package org.eclipse.cdt.internal.core.dom.parser.cpp;
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
import org.eclipse.cdt.core.dom.ast.IASTTypeId;
-import org.eclipse.cdt.core.dom.ast.IASTTypeIdExpression;
+import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTypeIdExpression;
/**
* @author jcamelon
*/
public class CPPASTTypeIdExpression extends CPPASTNode implements
- IASTTypeIdExpression {
+ ICPPASTTypeIdExpression {
private int op;
private IASTTypeId typeId;
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/GNUCPPSourceParser.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/GNUCPPSourceParser.java
index ce34421242a..24ff460f6ed 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/GNUCPPSourceParser.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/GNUCPPSourceParser.java
@@ -4549,21 +4549,21 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
*/
protected IASTExpression buildTypeIdExpression(int op, IASTTypeId typeId,
int startingOffset, int endingOffset) {
- IASTTypeIdExpression typeIdExpression = createTypeIdExpression();
+ ICPPASTTypeIdExpression typeIdExpression = createTypeIdExpression();
((ASTNode) typeIdExpression).setOffsetAndLength(startingOffset,
endingOffset - startingOffset);
((ASTNode) typeIdExpression).setLength(endingOffset - startingOffset);
typeIdExpression.setOperator(op);
typeIdExpression.setTypeId(typeId);
typeId.setParent(typeIdExpression);
- typeId.setPropertyInParent(IASTTypeIdExpression.TYPE_ID);
+ typeId.setPropertyInParent(ICPPASTTypeIdExpression.TYPE_ID);
return typeIdExpression;
}
/**
* @return
*/
- protected IASTTypeIdExpression createTypeIdExpression() {
+ protected ICPPASTTypeIdExpression createTypeIdExpression() {
return new CPPASTTypeIdExpression();
}

Back to the top